From 920d5f2e1d0700df2265a3324585f220471046e3 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 8 Oct 2008 14:31:35 +0200 Subject: [PATCH] Fixed zombie moans not looping when CVAR is 0 (disabled). --- src/zr/zombie.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/zr/zombie.inc b/src/zr/zombie.inc index f79a54e..b0fce06 100644 --- a/src/zr/zombie.inc +++ b/src/zr/zombie.inc @@ -196,11 +196,14 @@ Zombify_Mother(client) } new Float:interval = GetConVarFloat(gCvars[CVAR_EMITSOUNDS]); - if (tHandles[client][TMOAN] != INVALID_HANDLE) + if (interval > 0.0) { - CloseHandle(tHandles[client][TMOAN]); + if (tHandles[client][TMOAN] != INVALID_HANDLE) + { + CloseHandle(tHandles[client][TMOAN]); + } + tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT); } - tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT); if (tHandles[client][TPROTECT] != INVALID_HANDLE) { @@ -272,11 +275,14 @@ Zombify(client, attacker) CS_SwitchTeam(client, CS_TEAM_T); new Float:interval = GetConVarFloat(gCvars[CVAR_EMITSOUNDS]); - if (tHandles[client][TMOAN] != INVALID_HANDLE) + if (interval > 0.0) { - CloseHandle(tHandles[client][TMOAN]); + if (tHandles[client][TMOAN] != INVALID_HANDLE) + { + CloseHandle(tHandles[client][TMOAN]); + } + tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT); } - tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT); if (tHandles[client][TPROTECT] != INVALID_HANDLE) {