Imported fix from dev: 686:b0fc2136d03a - Fixed class attributes applied to early (moved to spawn post event). FOV (and possibly other stuff) was reset on spawn.

This commit is contained in:
Richard Helgeby 2010-04-05 00:54:21 +02:00
parent cb6f72c89d
commit 07b4ed9373
2 changed files with 22 additions and 3 deletions

View File

@ -214,7 +214,8 @@ public Action:EventPlayerSpawnPost(Handle:timer, any:client)
// Forward event to modules. // Forward event to modules.
WeaponsOnClientSpawnPost(client); WeaponsOnClientSpawnPost(client);
SEffectsOnClientSpawnPost(client); SEffectsOnClientSpawnPost(client);
SpawnProtectOnClientSpawnPost(client); ClassOnClientSpawnPost(client);
SpawnProtectOnClientSpawnPost(client); // Must be executed after class attributes are applied.
} }
/** /**

View File

@ -247,9 +247,10 @@ ClassOnClientSpawn(client)
} }
} }
// Apply class attributes for the active class. // Load class attributes for the active class.
ClassReloadPlayerCache(client, ClassGetActiveIndex(client)); ClassReloadPlayerCache(client, ClassGetActiveIndex(client));
ClassApplyAttributes(client);
// Note: Class attributes are applied in ClassOnClientSpawnPost.
// Check if instant class change cvar is set. // Check if instant class change cvar is set.
new Float:instantspawn = GetConVarFloat(g_hCvarsList[CVAR_CLASSES_CHANGE_TIMELIMIT]); new Float:instantspawn = GetConVarFloat(g_hCvarsList[CVAR_CLASSES_CHANGE_TIMELIMIT]);
@ -268,6 +269,23 @@ ClassOnClientSpawn(client)
} }
} }
/**
* Client have just spawned (delayed event).
*
* @param client The client index.
*/
ClassOnClientSpawnPost(client)
{
// Check if there are no valid classes. Block this event if classes aren't
// done loading.
if (!ClassValidated)
{
return;
}
ClassApplyAttributes(client);
}
/** /**
* Client died. Stops timers and reset certain attributes. Call this event to * Client died. Stops timers and reset certain attributes. Call this event to
* clean up class related stuff. * clean up class related stuff.