* Fixed a bug that attach effects were not stopped during resolution if the object to attach does no longer exist - added fix.

This commit is contained in:
LevelX2 2015-04-25 20:49:05 +02:00
parent 1e7f82bb3c
commit 159e36eabe

View file

@ -62,8 +62,10 @@ public class AttachEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = (Permanent)source.getSourceObjectIfItStillExists(game);
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
int zcc = game.getState().getZoneChangeCounter(sourcePermanent.getId());
if (zcc == source.getSourceObjectZoneChangeCounter() || zcc == source.getSourceObjectZoneChangeCounter() + 1) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
return permanent.addAttachment(source.getSourceId(), game);
@ -75,6 +77,7 @@ public class AttachEffect extends OneShotEffect {
}
}
}
}
return false;
}