other fixes

This commit is contained in:
BetaSteward 2012-02-04 17:05:48 -05:00
parent 90c7079bfa
commit bf9e25fc34
6 changed files with 56 additions and 12 deletions

View file

@ -1,6 +1,7 @@
package mage.abilities.dynamicvalue.common;
import mage.Constants;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.counters.CounterType;
@ -23,7 +24,9 @@ public class CountersCount implements DynamicValue {
Permanent p = game.getPermanent(sourceAbility.getSourceId());
// if permanent already leaves the battlefield, try to find counters count via last known information
if (p == null) {
p = (Permanent) game.getLastKnownInformation(sourceAbility.getSourceId(), Constants.Zone.BATTLEFIELD);
MageObject o = game.getLastKnownInformation(sourceAbility.getSourceId(), Constants.Zone.BATTLEFIELD);
if (o instanceof Permanent)
p = (Permanent) o;
}
if (p != null) {
return p.getCounters().getCount(counter);