fixed sizing issue. I keep forgetting array size calculation in C++ isn't just a property like in other languages. Sorry guys.

This commit is contained in:
techdragon.nguyen@gmail.com
2010-12-16 14:13:09 +00:00
parent e600c34852
commit 84e4213615

View File

@@ -708,7 +708,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
string thises[] = { "this(", "thisforeach(" };
found = string::npos;
int i = -1;
for (size_t j = 0; j < thises->length(); ++j)
for (size_t j = 0; j < sizeof(thises)/sizeof(string); j++)
{
size_t found2 = s.find(thises[j]);
if (found2 != string::npos && ((found == string::npos) || found2 < found))
@@ -792,7 +792,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
string lords[] = { "lord(", "foreach(", "aslongas(", "teach(", "all(" };
found = string::npos;
i = -1;
for (size_t j = 0; j < lords->length(); ++j)
for (size_t j = 0; j < sizeof(lords)/sizeof(string); ++j)
{
size_t found2 = s.find(lords[j]);
if (found2 != string::npos && ((found == string::npos) || found2 < found))