From: havoc Date: Mon, 15 Nov 2004 23:09:21 +0000 (+0000) Subject: fixed bug that called PlayerPreThink and PlayerPostThink on unspawned clients X-Git-Tag: xonotic-v0.1.0preview~5379 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e25cc7d795b69e12abe9b7967be8f27214b0b184;p=xonotic%2Fdarkplaces.git fixed bug that called PlayerPreThink and PlayerPostThink on unspawned clients git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4756 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sv_phys.c b/sv_phys.c index c03cdb26..b5427832 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1412,18 +1412,15 @@ void SV_Physics (void) if (pr_global_struct->force_retouch) SV_LinkEdict (ent, true); // force retouch even for stationary - if (i <= svs.maxclients) + if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned) { - if (i > 0) - { - // connected slot - // call standard client pre-think - SV_CheckVelocity (ent); - pr_global_struct->time = sv.time; - pr_global_struct->self = EDICT_TO_PROG(ent); - PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing"); - SV_CheckVelocity (ent); - } + // connected slot + // call standard client pre-think + SV_CheckVelocity (ent); + pr_global_struct->time = sv.time; + pr_global_struct->self = EDICT_TO_PROG(ent); + PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing"); + SV_CheckVelocity (ent); } else if (sv_freezenonclients.integer) continue; @@ -1492,7 +1489,7 @@ void SV_Physics (void) break; } - if (i <= svs.maxclients && i > 0 && !ent->e->free) + if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned) { SV_CheckVelocity (ent);