* Fixed a bug that abilities of sacrificed permanents did trigger if the spell they where sacrificed for triggered their triggered ability. (e.g. a Valakut sacrificed for a Scapeshift did still trigger if enough mountains where on the battlefield).

This commit is contained in:
LevelX2 2014-02-06 01:05:45 +01:00
parent ca831aee05
commit 4e2ed0178b
2 changed files with 3 additions and 1 deletions

View file

@ -64,7 +64,8 @@ public class TriggeredAbilities extends HashMap<String, TriggeredAbility> {
public void checkTriggers(GameEvent event, Game game) {
for (TriggeredAbility ability: this.values()) {
if (ability.isInUseableZone(game, null, true)) {
// for effects like when leaves battlefield use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring)
if (ability.isInUseableZone(game, null, event.getType().equals(GameEvent.EventType.ZONE_CHANGE) ? true :false)) {
MageObject object = null;
if (!ability.getZone().equals(Zone.COMMAND) && !game.getState().getZone(ability.getSourceId()).equals(ability.getZone())) {
object = game.getShortLivingLKI(ability.getSourceId(), ability.getZone());

View file

@ -41,6 +41,7 @@ import mage.game.permanent.Permanent;
* Is applied when the {@link Permanent} with this ability instance changes zones.
*
* @author BetaSteward_at_googlemail.com
* @param <T>
*/
public class ZoneChangeTriggeredAbility<T extends ZoneChangeTriggeredAbility<T>> extends TriggeredAbilityImpl<T> {