Fixed that evolve did not look for last known information of permanant that triggered evolve if permanent meanwhile left the battlefield.

This commit is contained in:
LevelX2 2013-03-04 08:46:03 +01:00
parent 3819db77ba
commit 9f8722c359

View file

@ -129,6 +129,9 @@ class EvolveEffect extends OneShotEffect<EvolveEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
UUID triggeringCreatureId = (UUID) getValue("triggeringCreature"); UUID triggeringCreatureId = (UUID) getValue("triggeringCreature");
Permanent triggeringCreature = game.getPermanent(triggeringCreatureId); Permanent triggeringCreature = game.getPermanent(triggeringCreatureId);
if (triggeringCreature == null) {
triggeringCreature = (Permanent) game.getLastKnownInformation(triggeringCreatureId, Zone.BATTLEFIELD);
}
if (triggeringCreature != null) { if (triggeringCreature != null) {
Permanent sourceCreature = game.getPermanent(source.getSourceId()); Permanent sourceCreature = game.getPermanent(source.getSourceId());
if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) { if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) {