mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Fixed a problem that DiesTriggeredAbilities from Tokens that were removed by an effect did nevertheless trigger (fixes #5825).
This commit is contained in:
parent
d458e73795
commit
8d46f46cf8
2 changed files with 36 additions and 41 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.MageObject;
|
||||
|
|
@ -34,11 +33,11 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility {
|
|||
if (before == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(before instanceof PermanentToken) && !this.hasSourceObjectAbility(game, before, event)) {
|
||||
if (!this.hasSourceObjectAbility(game, before, event)) { // the permanent does not have the ability so no trigger
|
||||
return false;
|
||||
}
|
||||
// check now it is in graveyard
|
||||
if (before.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(sourceId)) {
|
||||
// check now it is in graveyard if it is no token
|
||||
if (!(before instanceof PermanentToken) && before.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(sourceId)) {
|
||||
Zone after = game.getState().getZone(sourceId);
|
||||
return after != null && Zone.GRAVEYARD.match(after);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue