mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Fixed triggered abilities under opponent's control. +1 test passed.
This commit is contained in:
parent
9cb4ee1977
commit
cf8fa2b773
1 changed files with 6 additions and 1 deletions
|
@ -31,6 +31,7 @@ package mage.abilities;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -58,8 +59,12 @@ public class TriggeredAbilities extends HashMap<UUID, TriggeredAbility> {
|
||||||
object = game.getObject(ability.getSourceId());
|
object = game.getObject(ability.getSourceId());
|
||||||
}
|
}
|
||||||
if (object != null && object.getAbilities().contains(ability)) {
|
if (object != null && object.getAbilities().contains(ability)) {
|
||||||
|
if (object instanceof Permanent) {
|
||||||
|
ability.setControllerId(((Permanent) object).getControllerId());
|
||||||
|
}
|
||||||
if (ability.checkTrigger(event, game)) {
|
if (ability.checkTrigger(event, game)) {
|
||||||
ability.trigger(game, ability.getControllerId());
|
UUID controllerId = ability.getControllerId();
|
||||||
|
ability.trigger(game, controllerId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue