Explorar o código

case-insensitive cheats

Michael %!s(int64=2) %!d(string=hai) anos
pai
achega
70bdec41a3
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server/CGameHandler.cpp

+ 3 - 0
server/CGameHandler.cpp

@@ -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;