From 1078c6d22f6a8d084767a8ad17e1d634d1355436 Mon Sep 17 00:00:00 2001 From: Unnamed Date: Sat, 26 Jan 2019 03:59:21 +0000 Subject: [PATCH] Spam.cpp: fix voice command spam not working after level change --- src/hacks/Spam.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 40cf5d45..2266800a 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -259,8 +259,8 @@ void createMove() if (voicecommand_spam) { - static float last_voice_spam = 0.0f; - if (g_GlobalVars->curtime - 4.0F > last_voice_spam) + static Timer last_voice_spam; + if (last_voice_spam.test_and_set(4000)) { switch (*voicecommand_spam) { @@ -282,7 +282,6 @@ void createMove() case 6: // JEERS g_IEngine->ServerCmd("voicemenu 2 3"); } - last_voice_spam = g_GlobalVars->curtime; } } }