From 99373d5720885268a0b6cb66b2051beed2450e14 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 13 Nov 2008 17:03:28 +0100 Subject: [PATCH] Fixed invalid timer handle errors. Fixed client not in game error in ZR_DebugPrintToConsole. --- changelog.txt | 6 ++++-- src/zombiereloaded.sp | 2 +- src/zr/event.inc | 4 ++-- src/zr/zombie.inc | 3 +-- src/zr/zombiereloaded.inc | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/changelog.txt b/changelog.txt index fb2bd4e..e104cbd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,8 @@ -2008.11.11 - 2.5.1.11 - Richard - * zspawn confirmed fixed. +2008.11.13 - 2.5.1.11 - Richard + * ZSpawn fix confirmed. * Added debug messages on OnPlayerDisconnect and PlayerDeath. (zr_debug must be 2, might spam the console). + * Fixed invalid timer handle errors on OnClientDisconnect and PlayerDeath. + * Fixed client not in game error in ZR_DebugPrintToConsole. 2008.10.29 - 2.5.1.10 - Richard * Improved handling of invalid handle errors on OnClientDisconnect and PlayerDeath. diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 56c3930..5058800 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -188,7 +188,7 @@ public OnClientDisconnect(client) { if (debug_val > 1) { - Format(debug_msg, sizeof(debug_msg), "PlayerDeath - Killing timer %i with handle %x.", x, tHandles[client][x]); + Format(debug_msg, sizeof(debug_msg), "OnClientDisconnect - Killing timer %i with handle %x.", x, tHandles[client][x]); ZR_DebugPrintToConsole(0, debug_msg); } KillTimer(tHandles[client][x]); diff --git a/src/zr/event.inc b/src/zr/event.inc index 54f5021..25e2500 100644 --- a/src/zr/event.inc +++ b/src/zr/event.inc @@ -235,8 +235,8 @@ public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) } else { - SetPlayerAlpha(index, 255); - } + SetPlayerAlpha(index, 255); + } new bool:randomclass = GetConVarBool(gCvars[CVAR_CLASSES_RANDOM]); diff --git a/src/zr/zombie.inc b/src/zr/zombie.inc index 09391bb..394615a 100644 --- a/src/zr/zombie.inc +++ b/src/zr/zombie.inc @@ -892,8 +892,7 @@ public Action:RespawnTimer(Handle:timer, any:index) new team = GetClientTeam(index); if (!IsClientInGame(index) || IsPlayerAlive(index) || team != CS_TEAM_T && team != CS_TEAM_CT) { - tHandles[index][TZHP] = INVALID_HANDLE; - + tHandles[index][TRESPAWN] = INVALID_HANDLE; return; } diff --git a/src/zr/zombiereloaded.inc b/src/zr/zombiereloaded.inc index 0d246a2..677085c 100644 --- a/src/zr/zombiereloaded.inc +++ b/src/zr/zombiereloaded.inc @@ -207,7 +207,7 @@ ZR_DebugPrintToConsole(client, String:message[]) { if (client) { /* Client console */ - PrintToConsole(client, message); + if (IsClientInGame(client)) PrintToConsole(client, message); LogMessage("Debug log (client %i) -- %s", client, message); } else