Fixes issue when source for damage isn't on the battlefield anymore

This commit is contained in:
North 2012-03-12 23:27:48 +02:00
parent 480f30d30f
commit 8ea3cc741c

View file

@ -864,6 +864,12 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
int actualDamage = event.getAmount();
if (actualDamage > 0) {
Permanent source = game.getPermanent(sourceId);
if(source == null){
MageObject lastKnownInformation = game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD);
if(lastKnownInformation instanceof Permanent){
source = (Permanent) lastKnownInformation;
}
}
if (source != null && (source.getAbilities().containsKey(InfectAbility.getInstance().getId()))) {
addCounters(CounterType.POISON.createInstance(actualDamage), game);
} else {
@ -1389,6 +1395,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
// do nothing
}
@Override
public void setAllowBadMoves(boolean allowBadMoves) {
// do nothing
}