ifthen ability sometimes wasn't grabbing the right target, i now pass it through MTGAbility creations target.

also, i see now why targeted counter cost were left broken for so long. i think this way fixes it in all cases. what a pain.
This commit is contained in:
omegablast2002@yahoo.com
2011-09-15 11:50:04 +00:00
parent d04b4eca38
commit a6c458d0cb
4 changed files with 17 additions and 11 deletions

View File

@@ -626,11 +626,19 @@ int CounterCost::canPay()
if (counter->nb >= 0)
return 1; //add counters always possible
// otherwise, move on only if target has enough counters
Counter * targetCounter = NULL;
if(target)
{
Counter * targetCounter = target->counters->hasCounter(counter->name.c_str(), counter->power, counter->toughness);
if (targetCounter && targetCounter->nb >= -counter->nb)
return 1;
targetCounter = target->counters->hasCounter(counter->name.c_str(), counter->power, counter->toughness);
}
else
{
targetCounter = source->counters->hasCounter(counter->name.c_str(), counter->power, counter->toughness);
}
if (targetCounter && targetCounter->nb >= -counter->nb)
{
return 1;
}
return 0;
}