From ab7eb1b93e90d179795ae61933759ea26564f893 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Wed, 21 Sep 2011 12:37:44 +0000 Subject: [PATCH] fixed an error in my last commit. --- projects/mtg/src/AIPlayerBaka.cpp | 4 ++-- projects/mtg/src/AIPlayerBakaB.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 646c7ccc8..da20d4973 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -705,9 +705,9 @@ bool AIPlayerBaka::payTheManaCost(ManaCost * cost, MTGCardInstance * target,vect paid->add(amp->output); } } - if(k == gotPayments.size())//only add it once, and at the end. + if(k == gotPayments.size()-1)//only add it once, and at the end. paid->add(this->getManaPool());//incase some of our payments were mana already in the pool/. - if(paid->canAfford(cost) && (!cost->hasX() || k == gotPayments.size())) + if(paid->canAfford(cost) && (!cost->hasX() || k == gotPayments.size()-1)) { SAFE_DELETE(paid); for(size_t clicking = 0; clicking < clicks.size(); ++clicking) diff --git a/projects/mtg/src/AIPlayerBakaB.cpp b/projects/mtg/src/AIPlayerBakaB.cpp index ab30f95a3..5d9f67a9e 100644 --- a/projects/mtg/src/AIPlayerBakaB.cpp +++ b/projects/mtg/src/AIPlayerBakaB.cpp @@ -75,9 +75,9 @@ bool AIPlayerBakaB::payTheManaCost(ManaCost * cost, MTGCardInstance * target, ve paid->add(amp->output); } } - if(k == gotPayments.size())//add it once, and at the end. + if(k == gotPayments.size()-1)//add it once, and at the end. paid->add(this->getManaPool());//incase some of our payments were mana already in the pool/. - if(paid->canAfford(cost) && (!cost->hasX() || k == gotPayments.size())) + if(paid->canAfford(cost) && (!cost->hasX() || k == gotPayments.size()-1)) { SAFE_DELETE(paid); for(size_t clicking = 0; clicking < clicks.size(); ++clicking)