From 9fbbf5cde7c86f150f7c11dc75ac3a78b6ae18af Mon Sep 17 00:00:00 2001 From: furo Date: Tue, 27 Aug 2024 21:43:22 +0200 Subject: [PATCH 1/2] Fix using `random_unfinished_map` from rcon --- src/game/server/gamecontext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index eb5d69b6e..7193c8057 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -3140,6 +3140,8 @@ void CGameContext::ConRandomUnfinishedMap(IConsole::IResult *pResult, void *pUse CGameContext *pSelf = (CGameContext *)pUserData; int Stars = pResult->NumArguments() ? pResult->GetInteger(0) : -1; + if(pResult->m_ClientId != -1) + pSelf->m_VoteCreator = pResult->m_ClientId; pSelf->m_pScore->RandomUnfinishedMap(pSelf->m_VoteCreator, Stars); } From f407adc61c344d08a9103535941f16e5c99613a9 Mon Sep 17 00:00:00 2001 From: furo Date: Tue, 27 Aug 2024 21:44:00 +0200 Subject: [PATCH 2/2] Set `m_VoteCreator` when using `force_vote` --- src/game/server/gamecontext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 7193c8057..27cc8990d 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -3396,6 +3396,7 @@ void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData) { str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason); pSelf->SendChatTarget(-1, aBuf, FLAG_SIX); + pSelf->m_VoteCreator = pResult->m_ClientId; pSelf->Console()->ExecuteLine(pOption->m_aCommand); break; }