Răsfoiți Sursa

Trim cheats so 'vcmiartifacts ' will be recognized as single-word cheat

Ivan Savenko 1 an în urmă
părinte
comite
f14aec5876
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      server/processors/PlayerMessageProcessor.cpp

+ 1 - 1
server/processors/PlayerMessageProcessor.cpp

@@ -436,7 +436,7 @@ void PlayerMessageProcessor::cheatMaxMorale(PlayerColor player, const CGHeroInst
 bool PlayerMessageProcessor::handleCheatCode(const std::string & cheat, PlayerColor player, ObjectInstanceID currObj)
 bool PlayerMessageProcessor::handleCheatCode(const std::string & cheat, PlayerColor player, ObjectInstanceID currObj)
 {
 {
 	std::vector<std::string> words;
 	std::vector<std::string> words;
-	boost::split(words, cheat, boost::is_any_of("\t\r\n "));
+	boost::split(words, boost::trim_copy(cheat), boost::is_any_of("\t\r\n "));
 
 
 	if (words.empty() || !gameHandler->getStartInfo()->extraOptionsInfo.cheatsAllowed)
 	if (words.empty() || !gameHandler->getStartInfo()->extraOptionsInfo.cheatsAllowed)
 		return false;
 		return false;