diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java b/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java index 41fd3d62b4..e6bd123a26 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TreacherousPitDweller.java @@ -79,6 +79,7 @@ class TreacherousPitDwellerTriggeredAbility extends ZoneChangeTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE) && !permanent.getId().equals(this.getSourceId())) { + if (permanent.getCardType().contains(CardType.CREATURE) && !permanent.getId().equals(this.getSourceId())) { return true; } } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 997f4b831d..047221524a 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -463,7 +463,7 @@ public abstract class AbilityImpl> implements Ability { // try LKI first if (checkLKI) { - MageObject lkiTest = game.getLastKnownInformation(getSourceId(), zone); + MageObject lkiTest = game.getShortLivingLKI(getSourceId(), zone); if (lkiTest != null) { return true; } diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index db1982f747..704f6c43b3 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -112,8 +112,10 @@ public interface Game extends MageItem, Serializable { public boolean isSimulation(); public void setSimulation(boolean simulation); public MageObject getLastKnownInformation(UUID objectId, Zone zone); + public MageObject getShortLivingLKI(UUID objectId, Zone zone); public void rememberLKI(UUID objectId, Zone zone, MageObject object); public void resetLKI(); + public void resetShortLivingLKI(); public void setLosingPlayer(Player player); public Player getLosingPlayer(); public void setStateCheckRequired(); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index ff0261de74..ad9bc73225 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -98,8 +98,9 @@ public abstract class GameImpl> implements Game, Serializa protected Map gameCards = new HashMap(); protected Map lki = new HashMap(); + protected Map shortLivingLKI = new HashMap(); protected GameState state; - + protected Date startTime; protected Date endTime; protected UUID startingPlayerId; @@ -150,6 +151,7 @@ public abstract class GameImpl> implements Game, Serializa this.simulation = game.simulation; this.gameOptions = game.gameOptions; this.lki.putAll(game.lki); + this.shortLivingLKI.putAll(game.shortLivingLKI); if (logger.isDebugEnabled()) { copyCount++; copyTime += (System.currentTimeMillis() - t1); @@ -650,6 +652,7 @@ public abstract class GameImpl> implements Game, Serializa } resuming = false; } + resetShortLivingLKI(); resuming = false; if (isPaused() || isGameOver()) return; if (allPassed()) { @@ -661,6 +664,7 @@ public abstract class GameImpl> implements Game, Serializa fireUpdatePlayersEvent(); state.getRevealed().reset(); //resetLKI(); + resetShortLivingLKI(); break; } else { //removeBookmark(bookmark); @@ -1295,6 +1299,15 @@ public abstract class GameImpl> implements Game, Serializa return null; } + @Override + public MageObject getShortLivingLKI(UUID objectId, Zone zone) { + MageObject object = shortLivingLKI.get(objectId); + if (object != null) { + return object.copy(); + } + return null; + } + /** * Remembers object state to be used as Last Known Information. * @@ -1307,6 +1320,7 @@ public abstract class GameImpl> implements Game, Serializa if (object instanceof Permanent || object instanceof StackObject) { MageObject copy = object.copy(); lki.put(objectId, copy); + shortLivingLKI.put(objectId, copy); } } @@ -1318,6 +1332,11 @@ public abstract class GameImpl> implements Game, Serializa lki.clear(); } + @Override + public void resetShortLivingLKI() { + shortLivingLKI.clear(); + } + @Override public void cheat(UUID ownerId, Map commands) { if (commands != null) {