mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* 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:
parent
ca831aee05
commit
4e2ed0178b
2 changed files with 3 additions and 1 deletions
|
@ -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());
|
||||
|
|
|
@ -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> {
|
||||
|
||||
|
|
Loading…
Reference in a new issue