Another fix for #4090

This commit is contained in:
Zzooouhh 2017-11-02 07:05:33 +01:00 committed by GitHub
parent 4c8245020a
commit f653ddb921
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ import mage.abilities.effects.RedirectionEffect;
import mage.constants.Duration; import mage.constants.Duration;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/** /**
* *
@ -33,9 +34,14 @@ public class RedirectDamageFromSourceToTargetEffect extends RedirectionEffect {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) { Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
this.redirectTarget = source.getTargets().get(0); if (permanent != null) {
return true; if (event.getTargetId().equals(source.getSourceId())) {
if (getTargetPointer().getFirst(game, source) != null) {
this.redirectTarget = source.getTargets().get(0);
return true;
}
}
} }
return false; return false;
} }