Fixed invalid timer handle errors. Fixed client not in game error in ZR_DebugPrintToConsole.
This commit is contained in:
		| @@ -1,6 +1,8 @@ | |||||||
| 2008.11.11 - 2.5.1.11 - Richard | 2008.11.13 - 2.5.1.11 - Richard | ||||||
|   * zspawn confirmed fixed. |   * ZSpawn fix confirmed. | ||||||
|   * Added debug messages on OnPlayerDisconnect and PlayerDeath. (zr_debug must be 2, might spam the console). |   * 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 | 2008.10.29 - 2.5.1.10 - Richard | ||||||
|   * Improved handling of invalid handle errors on OnClientDisconnect and PlayerDeath. |   * Improved handling of invalid handle errors on OnClientDisconnect and PlayerDeath. | ||||||
|   | |||||||
| @@ -188,7 +188,7 @@ public OnClientDisconnect(client) | |||||||
|         { |         { | ||||||
|             if (debug_val > 1) |             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); |                 ZR_DebugPrintToConsole(0, debug_msg); | ||||||
|             } |             } | ||||||
|             KillTimer(tHandles[client][x]); |             KillTimer(tHandles[client][x]); | ||||||
|   | |||||||
| @@ -235,8 +235,8 @@ public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) | |||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
| 		SetPlayerAlpha(index, 255); |         SetPlayerAlpha(index, 255); | ||||||
| 	} |     } | ||||||
|      |      | ||||||
|     new bool:randomclass = GetConVarBool(gCvars[CVAR_CLASSES_RANDOM]); |     new bool:randomclass = GetConVarBool(gCvars[CVAR_CLASSES_RANDOM]); | ||||||
|      |      | ||||||
|   | |||||||
| @@ -892,8 +892,7 @@ public Action:RespawnTimer(Handle:timer, any:index) | |||||||
|     new team = GetClientTeam(index); |     new team = GetClientTeam(index); | ||||||
|     if (!IsClientInGame(index) || IsPlayerAlive(index) || team != CS_TEAM_T && team != CS_TEAM_CT) |     if (!IsClientInGame(index) || IsPlayerAlive(index) || team != CS_TEAM_T && team != CS_TEAM_CT) | ||||||
|     { |     { | ||||||
|         tHandles[index][TZHP] = INVALID_HANDLE; |         tHandles[index][TRESPAWN] = INVALID_HANDLE; | ||||||
|          |  | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|   | |||||||
| @@ -207,7 +207,7 @@ ZR_DebugPrintToConsole(client, String:message[]) | |||||||
| { | { | ||||||
|     if (client) |     if (client) | ||||||
|     { /* Client console */ |     { /* Client console */ | ||||||
|         PrintToConsole(client, message); |         if (IsClientInGame(client)) PrintToConsole(client, message); | ||||||
|         LogMessage("Debug log (client %i) -- %s", client, message); |         LogMessage("Debug log (client %i) -- %s", client, message); | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user