File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -297,20 +297,25 @@ void Host_Say(edict_t *pEntity, int teamonly)
297
297
CBasePlayer *player = GetClassPtr ((CBasePlayer *)pev);
298
298
299
299
// Flood check
300
- if (player->m_flNextChatTime > gpGlobals->time )
300
+ // Note: Use g_engfuncs.pfnTime() instead of gpGlobals->time because it doesn't work in pause
301
+ float asyncTime = g_engfuncs.pfnTime ();
302
+
303
+ if (player->m_flNextChatTime > asyncTime)
301
304
{
302
305
if (player->m_iChatFlood >= CHAT_FLOOD)
303
306
{
304
- player->m_flNextChatTime = gpGlobals-> time + CHAT_INTERVAL + CHAT_PENALTY;
307
+ player->m_flNextChatTime = asyncTime + CHAT_INTERVAL + CHAT_PENALTY;
305
308
return ;
306
309
}
310
+
307
311
player->m_iChatFlood ++;
308
312
}
309
313
else if (player->m_iChatFlood )
310
314
{
311
315
player->m_iChatFlood --;
312
316
}
313
- player->m_flNextChatTime = gpGlobals->time + CHAT_INTERVAL;
317
+
318
+ player->m_flNextChatTime = asyncTime + CHAT_INTERVAL;
314
319
315
320
// We can get a raw string now, without the "say " prepended
316
321
if (!_stricmp (pcmd, cpSay) || !_stricmp (pcmd, cpSayTeam))
Original file line number Diff line number Diff line change @@ -3471,7 +3471,7 @@ void CBasePlayer::Spawn(void)
3471
3471
m_lastx = m_lasty = 0 ;
3472
3472
3473
3473
m_iChatFlood = 0 ;
3474
- m_flNextChatTime = gpGlobals->time ;
3474
+ m_flNextChatTime = 0 ; // Not using gpGlobals->time - see Host_Say
3475
3475
m_flNextFullupdate[0 ] = gpGlobals->time ;
3476
3476
m_flNextFullupdate[1 ] = gpGlobals->time ;
3477
3477
You can’t perform that action at this time.
0 commit comments