From 67ebd964e1fd4a7f2fe7262111adad9f1919811d Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sat, 2 Apr 2011 21:01:33 +0000 Subject: [PATCH] 2 bug fixes; first, while hunting down easter eggs in the todo.dat i started trying to code some un-added equipment...noticed that thisforeach was exhabiting strange behavior. what was happening was in the changed line, abilities.size() was a non-static number, so on most abilities, thisforeach was actually stopping prematurely. which explains why there was no test added for thisforeach, becuase it really wasnt working correctly. what i did to correct the issue was set "i" as an unsigned int = abilities.size()..this way abilities being added don't stop it prematurely in the process of adding the matches. 2nd, this one is geared towards equipment only, it is a bug fix, not a "lets recode all equipment to use this"...i noticed that alot of equipment was suffering from double entries of activated abilities, the first entry was always targeted at the equipment and did nothing in most cases, the 2nd was always added during the getabilities call. to fix, i added autoskill= ...what this line is used for it activated abilities or abilities that otherwise shouldnt exist when the card is not equipped, it is called on when getabilities function is called by equip() and for removel purposes. --- projects/mtg/include/AllAbilities.h | 7 +++++-- projects/mtg/src/MTGAbility.cpp | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 6bcbca24a..348e9aef6 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3354,7 +3354,7 @@ public: int resolve() { //TODO check if ability is oneShot ? - int matches; + unsigned int matches; matches = td->match(source); if (matches > 0) { @@ -3362,7 +3362,10 @@ public: { removeAbilityFromGame(); } - for (int i = 0; i < matches - (int) (abilities.size()); i++) + // 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++) { addAbilityToGame(); } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index fe930e4ed..6188f6adc 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3073,6 +3073,13 @@ int AbilityFactory::getAbilities(vector * v, Spell * spell, MTGCar magicText.append(faceupC); } + else if(card && card->hasType("equipment") && card->target) + { + magicText = card->model->data->magicText; + string equipText = card->magicTexts["skill"]; + magicText.append("\n"); + magicText.append(equipText); + } else { magicText = card->magicText;