mirror of
https://github.com/correl/mage.git
synced 2025-03-16 17:00:13 -09:00
Another fix for #4090
This commit is contained in:
parent
4c8245020a
commit
f653ddb921
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue