Fixed spawn protect firing twice causing the timer to execute twice a second, halving the time.

This commit is contained in:
Greyscale 2009-06-26 23:28:46 -07:00
parent 85c3400a62
commit ca820b6b53
2 changed files with 12 additions and 15 deletions

View File

@ -187,7 +187,6 @@ public Action:EventPlayerSpawn(Handle:event, const String:name[], bool:dontBroad
WeaponsOnClientSpawn(index);
RoundStartOnClientSpawn(index);
SEffectsOnClientSpawn(index);
SpawnProtectOnClientSpawn(index);
RespawnOnClientSpawn(index);
ZTeleOnClientSpawn(index);
ZHPOnClientSpawn(index);

View File

@ -47,14 +47,17 @@ SpawnProtectClientInit(client)
}
/**
* Client is spawning into the game.
* Client is spawning into the game. *Post
*
* @param client The client index.
*/
SpawnProtectOnClientSpawn(client)
*/
SpawnProtectOnClientSpawnPost(client)
{
// Disable spawn protection on client.
bInfectImmune[client][INFECT_TYPE_NORMAL] = false;
// If client is dead, then they are joining the server, not spawning.
if (!IsPlayerAlive(client))
{
return;
}
// If timer is currently running, kill it.
if (tSpawnProtect[client] != INVALID_HANDLE)
@ -64,15 +67,7 @@ SpawnProtectOnClientSpawn(client)
// Reset timer handle.
tSpawnProtect[client] = INVALID_HANDLE;
}
/**
* Client is spawning into the game. *Post
*
* @param client The client index.
*/
SpawnProtectOnClientSpawnPost(client)
{
// If protect cvar is disabled, then stop.
new bool:protect = GetConVarBool(g_hCvarsList[CVAR_SPAWNPROTECT]);
if (!protect)
@ -80,6 +75,9 @@ SpawnProtectOnClientSpawnPost(client)
return;
}
// Disable spawn protection on client.
bInfectImmune[client][INFECT_TYPE_NORMAL] = false;
// Start spawn protection.
SpawnProtectStart(client);
}