diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 8d40639b3..6124507ca 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -232,7 +232,8 @@ void TestSuiteState::parsePlayerState(int playerId, string s){ unsigned int value; limiter = s.find(","); if (limiter != string::npos){ - value = Rules::getMTGId(trim(s.substr(0,limiter))); + string ss = s.substr(0,limiter); // ss is needed because trim requires a non-const reference, + value = Rules::getMTGId(trim(ss)); // while in g++ functions cannot take non-const references from temporary values s = s.substr(limiter+1); }else{ value = Rules::getMTGId(trim(s)); @@ -610,4 +611,4 @@ void TestSuite::pregameTests(){ if(!sb.unitTest()) nbFailed++; } -} \ No newline at end of file +}