mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00: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.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -33,9 +34,14 @@ public class RedirectDamageFromSourceToTargetEffect extends RedirectionEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.redirectTarget = source.getTargets().get(0);
|
||||
return true;
|
||||
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
if (getTargetPointer().getFirst(game, source) != null) {
|
||||
this.redirectTarget = source.getTargets().get(0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue