From 9c9ce69259101df22ca0c667a7f142d86d707025 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Wed, 14 Sep 2011 12:20:46 +0000 Subject: [PATCH] safing up countercost related items, some possible crashes were found now that counter cost can be targeted. they should have really been there from the start. --- projects/mtg/src/ExtraCost.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index 4af17779b..912a9f87b 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -621,6 +621,8 @@ int CounterCost::isPaymentSet() int CounterCost::canPay() { // if target needs to be chosen, then move on. + if(!target) + return 0; if (tc) return 1; if (counter->nb >= 0) @@ -758,7 +760,8 @@ int ExtraCosts::canPay() { if (!costs[i]->canPay()) { - costs[i]->target->isExtraCostTarget = false; + if(costs[i]->target) + costs[i]->target->isExtraCostTarget = false; return 0; } }