From d3491698bc2a3c1de4304cf563372f07c54a00a7 Mon Sep 17 00:00:00 2001 From: dystopm Date: Sat, 10 Aug 2024 17:31:59 -0400 Subject: [PATCH] Ensure timers check before new restrictions --- regamedll/dlls/client.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index b5c029392..9708fa2c8 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -2619,6 +2619,14 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa { if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTE]) { + pPlayer->m_flLastCommandTime[CMD_VOTE] = gpGlobals->time + 0.3f; + + if (gpGlobals->time < pPlayer->m_flNextVoteTime) + { + ClientPrint(pPlayer->pev, HUD_PRINTCONSOLE, "#Wait_3_Seconds"); + return; + } + #ifdef REGAMEDLL_ADD static const int flagKick = UTIL_ReadFlags("k"); if ((flagKick & UTIL_ReadFlags(vote_flags.string)) == 0) @@ -2627,13 +2635,6 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa return; } #endif - pPlayer->m_flLastCommandTime[CMD_VOTE] = gpGlobals->time + 0.3f; - - if (gpGlobals->time < pPlayer->m_flNextVoteTime) - { - ClientPrint(pPlayer->pev, HUD_PRINTCONSOLE, "#Wait_3_Seconds"); - return; - } pPlayer->m_flNextVoteTime = gpGlobals->time + 3; @@ -2708,6 +2709,14 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa { if (gpGlobals->time >= pPlayer->m_flLastCommandTime[CMD_VOTEMAP]) { + pPlayer->m_flLastCommandTime[CMD_VOTEMAP] = gpGlobals->time + 0.3f; + + if (gpGlobals->time < pPlayer->m_flNextVoteTime) + { + ClientPrint(pPlayer->pev, HUD_PRINTCONSOLE, "#Wait_3_Seconds"); + return; + } + #ifdef REGAMEDLL_ADD static const int flagMap = UTIL_ReadFlags("m"); if ((flagMap & UTIL_ReadFlags(vote_flags.string)) == 0) @@ -2716,13 +2725,6 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa return; } #endif - pPlayer->m_flLastCommandTime[CMD_VOTEMAP] = gpGlobals->time + 0.3f; - - if (gpGlobals->time < pPlayer->m_flNextVoteTime) - { - ClientPrint(pPlayer->pev, HUD_PRINTCONSOLE, "#Wait_3_Seconds"); - return; - } pPlayer->m_flNextVoteTime = gpGlobals->time + 3;