Fix NPE when attaching aura with Genesis Hydra

This commit is contained in:
tool4EvEr
2021-10-01 18:49:54 +02:00
parent f452e86221
commit c1fa46df39
2 changed files with 12 additions and 2 deletions

View File

@@ -3,11 +3,13 @@ package forge.game.ability.effects;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import forge.card.MagicColor;
import forge.game.Game;
import forge.game.GameActionUtil;
import forge.game.GameEntityCounterTable;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
@@ -323,7 +325,10 @@ public class DigEffect extends SpellAbilityEffect {
}
c = game.getAction().moveTo(zone, c, libraryPosition, sa);
} else {
c = game.getAction().moveTo(zone, c, sa);
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
moveParams.put(AbilityKey.LastStateBattlefield, game.copyLastStateBattlefield());
moveParams.put(AbilityKey.LastStateGraveyard, game.copyLastStateGraveyard());
c = game.getAction().moveTo(zone, c, sa, moveParams);
if (destZone1.equals(ZoneType.Battlefield)) {
if (sa.hasParam("Tapped")) {
c.setTapped(true);

View File

@@ -2,8 +2,10 @@ package forge.game.ability.effects;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import forge.game.Game;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
@@ -177,7 +179,10 @@ public class DigUntilEffect extends SpellAbilityEffect {
Card m = null;
if (sa.hasParam("GainControl") && foundDest.equals(ZoneType.Battlefield)) {
c.setController(sa.getActivatingPlayer(), game.getNextTimestamp());
m = game.getAction().moveTo(c.getController().getZone(foundDest), c, sa);
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
moveParams.put(AbilityKey.LastStateBattlefield, game.copyLastStateBattlefield());
moveParams.put(AbilityKey.LastStateGraveyard, game.copyLastStateGraveyard());
m = game.getAction().moveTo(c.getController().getZone(foundDest), c, sa, moveParams);
if (sa.hasParam("Tapped")) {
c.setTapped(true);
}