diff --git a/projects/mtg/include/MTGGameZones.h b/projects/mtg/include/MTGGameZones.h index 9970ff4d9..7310d65d0 100644 --- a/projects/mtg/include/MTGGameZones.h +++ b/projects/mtg/include/MTGGameZones.h @@ -95,7 +95,7 @@ class MTGGameZone { void cleanupPhase(); void beforeBeginPhase(); - unsigned int countByType(const char * value); + unsigned int countByType(const string &value); unsigned int countByCanTarget(TargetChooser * tc); unsigned int countTotalManaSymbols(TargetChooser * tc, int color); MTGCardInstance * findByName(string name); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index b7dcda29c..7d16dfdd1 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1042,7 +1042,7 @@ void GameObserver::Affinity() } else { - reduce = card->controller()->game->battlefield->countByType(type.c_str()); + reduce = card->controller()->game->battlefield->countByType(type); } for(int i = 0; i < reduce;i++) { diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 56f7efe12..4a425ed1c 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -529,7 +529,7 @@ size_t MTGGameZone::getIndex(MTGCardInstance * card) } -unsigned int MTGGameZone::countByType(const char * value) +unsigned int MTGGameZone::countByType(const string &value) { int result = 0; int subTypeId = MTGAllCards::findType(value); @@ -539,7 +539,7 @@ unsigned int MTGGameZone::countByType(const char * value) { result++; } - else if(strcmp(value, "token") == 0 && cards[i]->isToken) + else if(value == "token" && cards[i]->isToken) result++; } return result;