* Fix a warning.
This commit is contained in:
jean.chalard
2008-12-25 13:18:54 +00:00
parent d7cd0f5bab
commit bb9f09df82
2 changed files with 5 additions and 5 deletions

View File

@@ -62,13 +62,13 @@ int AbilityFactory::putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone
int AbilityFactory::parsePowerToughness(string s, int *power, int *toughness){
int found = s.find("/");
size_t found = s.find("/");
if (found != string::npos){
unsigned int start = s.find(":");
size_t start = s.find(":");
if (start == string::npos) start = s.find(" ");
if (start == string::npos) start = -1;
*power = atoi(s.substr(start+1,s.size()-found).c_str());
unsigned int end = s.find(" ",start);
size_t end = s.find(" ",start);
if (end != string::npos){
*toughness = atoi(s.substr(found+1,end-found-1).c_str());
}else{

View File

@@ -349,5 +349,5 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc
if(zoneName.compare("myremovedfromgame") == 0)return p->game->removedFromGame;
if(zoneName.compare("opponentremovedfromgame") == 0) return p->opponent()->game->removedFromGame;
if(zoneName.compare("ownerhremovedfromgame") == 0) return source->owner->game->removedFromGame;
}
return NULL;
}