From bbd34c94529e43e324693b2bb6ab9395aeee1669 Mon Sep 17 00:00:00 2001 From: furo Date: Fri, 6 Sep 2024 18:56:58 +0200 Subject: [PATCH] Fix `random_unfinished_map` not working with `vote yes` --- src/game/server/gamecontext.cpp | 4 +--- src/game/server/gamecontext.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index f88d12dc4..eb5360354 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -773,7 +773,6 @@ void CGameContext::StartVote(const char *pDesc, const char *pCommand, const char { // reset votes m_VoteEnforce = VOTE_ENFORCE_UNKNOWN; - m_VoteEnforcer = -1; for(auto &pPlayer : m_apPlayers) { if(pPlayer) @@ -1204,7 +1203,7 @@ void CGameContext::OnTick() } else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN) { - Console()->ExecuteLine(m_aVoteCommand, m_VoteEnforcer); + Console()->ExecuteLine(m_aVoteCommand, m_VoteCreator); SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, FLAG_SIX); EndVote(); } @@ -4820,7 +4819,6 @@ void CGameContext::ForceVote(int EnforcerId, bool Success) return; m_VoteEnforce = Success ? CGameContext::VOTE_ENFORCE_YES_ADMIN : CGameContext::VOTE_ENFORCE_NO_ADMIN; - m_VoteEnforcer = EnforcerId; char aBuf[256]; const char *pOption = Success ? "yes" : "no"; diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index dd5868d07..1e418d001 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -575,7 +575,6 @@ public: VOTE_TYPE_SPECTATE, }; int m_VoteVictim; - int m_VoteEnforcer; inline bool IsOptionVote() const { return m_VoteType == VOTE_TYPE_OPTION; } inline bool IsKickVote() const { return m_VoteType == VOTE_TYPE_KICK; }