* Fixed a bug that if power/toughness was set from a creature itself (e.g. Marsh Fitter) the effect was still applied if the creature left the battlefield and returned within the duration of the effect.

This commit is contained in:
LevelX2 2015-04-12 23:31:05 +02:00
parent 0ae89c453c
commit 203b65c584
3 changed files with 10 additions and 3 deletions

View file

@ -36,6 +36,7 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
/**
@ -75,7 +76,13 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
MageObject mageObject = game.getObject(source.getSourceId()); // there are character definig abilities (e.g. P/T Nightmare) that have to work also for P/T of cards
MageObject mageObject;
if (source.getZone() == Zone.BATTLEFIELD) {
mageObject = source.getSourceObjectIfItStillExists(game);
} else {
mageObject = game.getObject(source.getSourceId()); // there are character definig abilities (e.g. P/T Nightmare) that have to work also for P/T of cards
}
if (mageObject == null) {
if (duration.equals(Duration.Custom)) {
discard();