Skip to content

Commit

Permalink
Ensure timers check before new restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
dystopm committed Aug 10, 2024
1 parent 8aba6f6 commit d349169
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down Expand Up @@ -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)
Expand All @@ -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;

Expand Down

0 comments on commit d349169

Please sign in to comment.