Fixed ragdolls being removed in spawn event when removal is disabled.

This commit is contained in:
Richard Helgeby 2012-02-26 15:39:12 +01:00
parent 4e68b52301
commit 7cad0b6281
2 changed files with 16 additions and 0 deletions

View File

@ -174,6 +174,13 @@ bool:RespawnSpawnClient(client, bool:zombie = false, bool:zombieIfSuicide = fals
// Restore respawn condition.
RespawnRestoreCondition(condition, zombie, zombieIfSuicide);
new bool:ragdollremove = GetConVarBool(g_hCvarsList[CVAR_VEFFECTS_RAGDOLL_REMOVE]);
if (!ragdollremove)
{
// Detatch ragdoll so it's not removed on respawn.
RagdollResetClientRagdoll(client);
}
// Spawn player.
CS_RespawnPlayer(client);

View File

@ -179,3 +179,12 @@ RagdollGetClientRagdoll(client)
{
return GetEntDataEnt2(client, g_iToolsRagdoll);
}
/**
* Removes the ragdoll entity of a client.
* @param client The client index.
*/
RagdollResetClientRagdoll(client)
{
SetEntDataEnt2(client, g_iToolsRagdoll, -1);
}