* Fixed some target pointer handling.

This commit is contained in:
LevelX2 2018-02-22 17:46:23 +01:00
parent 88dd301f82
commit c02c5a175b
14 changed files with 140 additions and 108 deletions

View file

@ -1211,6 +1211,19 @@ public abstract class AbilityImpl implements Ability {
return null;
}
@Override
public Permanent getSourcePermanentIfItStillExists(Game game) {
if (sourceObject == null) {
setSourceObject(game.getObject(getSourceId()), game);
}
if (sourceObject instanceof Permanent) {
if (game.getState().getZoneChangeCounter(getSourceId()) == getSourceObjectZoneChangeCounter()) {
return (Permanent) sourceObject;
}
}
return null;
}
@Override
public int getSourceObjectZoneChangeCounter() {
return sourceObjectZoneChangeCounter;