1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #2173 from Laserlicht/patch-1

case-insensitive cheats
This commit is contained in:
Ivan Savenko
2023-05-20 19:25:27 +03:00
committed by GitHub

View File

@@ -6870,6 +6870,9 @@ void CGameHandler::spawnWanderingMonsters(CreatureID creatureID)
void CGameHandler::handleCheatCode(std::string & cheat, PlayerColor player, const CGHeroInstance * hero, const CGTownInstance * town, bool & cheated)
{
//Make cheat case-insensitive
std::transform(cheat.begin(), cheat.end(), cheat.begin(), [](unsigned char c){ return std::tolower(c); });
if (cheat == "vcmiistari" || cheat == "vcmispells")
{
cheated = true;