J :
* Fix a warning.
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user