Fixed Oblivion Ring issue (LeavesBattlefieldTriggeredAbility).

This commit is contained in:
magenoxx 2012-03-26 00:42:04 +04:00
parent 569faf8fd3
commit 46439e7ffe

View file

@ -36,6 +36,7 @@ import mage.Constants.AbilityType;
import mage.Constants.EffectType;
import mage.Constants.Outcome;
import mage.Constants.Zone;
import mage.MageObject;
import mage.abilities.costs.*;
import mage.abilities.costs.mana.KickerManaCost;
import mage.abilities.costs.mana.ManaCost;
@ -463,6 +464,13 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
@Override
public boolean isInUseableZone(Game game) {
// try LKI first
MageObject lkiTest = game.getLastKnownInformation(getSourceId(), zone);
if (lkiTest != null) {
return true;
}
// check against current state
Zone test = game.getState().getZone(sourceId);
return test != null && zone.match(test);
}