Removed all non-forwarding code from events.inc and moved to appropriate modules.

This commit is contained in:
Greyscale 2009-05-20 19:15:55 -07:00
parent 6e464880f4
commit a1aebe5ca5
3 changed files with 24 additions and 25 deletions

View File

@ -153,32 +153,10 @@ public Action:EventPlayerSpawn(Handle:event, const String:name[], bool:dontBroad
// Get all required event info. // Get all required event info.
new index = GetClientOfUserId(GetEventInt(event, "userid")); new index = GetClientOfUserId(GetEventInt(event, "userid"));
// Reset FOV and overlay.
ToolsSetClientDefaultFOV(index, 90);
ClientCommand(index, "r_screenoverlay \"\"");
// Check if client is on a team.
if (ZRIsClientOnTeam(index))
{
// Turn off nightvision.
ToolsClientNightVision(index, false, false);
// Take nightvision away.
ToolsClientNightVision(index, false);
if (g_bZombieSpawned)
{
if (ZRIsClientOnTeam(index, CS_TEAM_T))
{
CS_SwitchTeam(index, CS_TEAM_CT);
CS_RespawnPlayer(index);
}
}
}
// Forward event to modules. // Forward event to modules.
InfectOnClientSpawn(index); InfectOnClientSpawn(index); // Multiple modules depend on this to finish first.
ClassOnClientSpawn(index); // Module event depends on infect module. OverlaysOnClientSpawn(index);
ClassOnClientSpawn(index);
RestrictOnClientSpawn(index); RestrictOnClientSpawn(index);
SEffectsOnClientSpawn(index); SEffectsOnClientSpawn(index);
AccountOnClientSpawn(index); AccountOnClientSpawn(index);

View File

@ -213,6 +213,16 @@ InfectOnClientSpawn(client)
{ {
// Disable zombie flag on client. // Disable zombie flag on client.
bZombie[client] = false; bZombie[client] = false;
// Check if client is spawning on the terrorist team.
if (ZRIsClientOnTeam(client, CS_TEAM_T))
{
if (g_bZombieSpawned)
{
CS_SwitchTeam(client, CS_TEAM_CT);
CS_RespawnPlayer(client);
}
}
} }
/** Client has been hurt. /** Client has been hurt.

View File

@ -129,6 +129,17 @@ public OverlaysQueryClientDXLevel(QueryCookie:cookie, client, ConVarQueryResult:
g_iOverlaysDXL[client] = StringToInt(cvarValue); g_iOverlaysDXL[client] = StringToInt(cvarValue);
} }
/**
* Client is spawning into the game.
*
* @param client The client index.
*/
OverlaysOnClientSpawn(client)
{
// Update overlay.
OverlaysClientUpdateOverlay(client);
}
/** /**
* The round is starting. * The round is starting.
*/ */