From 206f3b4d3f341996bf87b66f668bd9e63c92b86b Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Tue, 20 Sep 2011 17:03:31 +0000 Subject: [PATCH] fixed a crash that happens in thisforeach when the matches is a negitive value. --- projects/mtg/include/AllAbilities.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index b861e1eff..35572b186 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2907,18 +2907,18 @@ public: int resolve() { //TODO check if ability is oneShot ? - unsigned int matches; + int matches; matches = td->match(source); if (matches > 0) { - if ((unsigned int) (abilities.size()) > matches) + if (abilities.size() > (size_t)matches) { removeAbilityFromGame(); } // i will equal abilities size, then we increment from there //abilities size was previously being subtracted from matches //tho since it was a nonstatic number, it would stop adding abilities prematurely. - for (unsigned int i = abilities.size(); i < matches; i++) + for (size_t i = abilities.size(); i < (size_t)matches; i++) { addAbilityToGame(); }