1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Merge pull request #3737 from IvanSavenko/trim_cheats

Trim cheats so 'vcmiartifacts ' will be recognized as single-word cheat
This commit is contained in:
Ivan Savenko 2024-04-10 11:11:32 +03:00 committed by GitHub
commit 8cf3477b82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -436,7 +436,7 @@ void PlayerMessageProcessor::cheatMaxMorale(PlayerColor player, const CGHeroInst
bool PlayerMessageProcessor::handleCheatCode(const std::string & cheat, PlayerColor player, ObjectInstanceID currObj)
{
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)
return false;