From c3f6d89cac8967adb3c19c2ecae8cd405d7fee5c Mon Sep 17 00:00:00 2001 From: def Date: Mon, 16 Nov 2020 17:32:46 +0100 Subject: [PATCH] Fix random map vote reason to set stars Caused by the hotfix for solo cheat As reported by maggi323 --- src/game/server/gamecontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 3ebb43fef..9101eef68 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1812,7 +1812,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) SendChatTarget(ClientID, "Invalid option"); return; } - if((str_startswith(pOption->m_aCommand, "sv_map ") || str_startswith(pOption->m_aCommand, "change_map ") || str_startswith(pOption->m_aCommand, "random_map") || str_startswith(pOption->m_aCommand, "random_unfinished_map")) && RateLimitPlayerMapVote(ClientID)) + if((str_find(pOption->m_aCommand, "sv_map ") != 0 || str_find(pOption->m_aCommand, "change_map ") != 0 || str_find(pOption->m_aCommand, "random_map") != 0 || str_find(pOption->m_aCommand, "random_unfinished_map") != 0) && RateLimitPlayerMapVote(ClientID)) { return; } @@ -1821,7 +1821,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) pOption->m_aDescription, aReason); str_format(aDesc, sizeof(aDesc), "%s", pOption->m_aDescription); - if((str_startswith(pOption->m_aCommand, "random_map") || str_startswith(pOption->m_aCommand, "random_unfinished_map")) && str_length(aReason) == 1 && aReason[0] >= '0' && aReason[0] <= '5') + if((str_endswith(pOption->m_aCommand, "random_map") || str_endswith(pOption->m_aCommand, "random_unfinished_map")) && str_length(aReason) == 1 && aReason[0] >= '0' && aReason[0] <= '5') { int Stars = aReason[0] - '0'; str_format(aCmd, sizeof(aCmd), "%s %d", pOption->m_aCommand, Stars);