From 6730b32ecfebdc4be197863668910523927a9269 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 17 Jan 2005 23:17:31 +0000 Subject: [PATCH] implemented the 'don't move projectiles on first frame' hack a different way git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4942 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sv_phys.c b/sv_phys.c index b1e8814a..df4990be 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1222,10 +1222,6 @@ void SV_Physics_Toss (edict_t *ent) vec3_t move; edict_t *groundentity; - // regular thinking - if (!SV_RunThink (ent)) - return; - // don't stick to ground if onground and moving upward if (ent->v->velocity[2] >= (1.0 / 32.0) && ((int)ent->v->flags & FL_ONGROUND)) ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND; @@ -1385,6 +1381,7 @@ void SV_Physics (void) { int i; edict_t *ent; + qbyte runmove[MAX_EDICTS]; // let the progs know that a new frame has started pr_global_struct->self = EDICT_TO_PROG(sv.edicts); @@ -1392,11 +1389,14 @@ void SV_Physics (void) pr_global_struct->time = sv.time; PR_ExecuteProgram (pr_global_struct->StartFrame, "QC function StartFrame is missing"); + for (i = 0, ent = sv.edicts;i < sv.num_edicts;i++, ent = NEXT_EDICT(ent)) + runmove[i] = !ent->e->free; + // // treat each object in turn // - ent = sv.edicts; - for (i=0 ; ie->free) continue; @@ -1462,19 +1462,21 @@ void SV_Physics (void) case MOVETYPE_BOUNCE: case MOVETYPE_BOUNCEMISSILE: case MOVETYPE_FLYMISSILE: - SV_Physics_Toss (ent); + // regular thinking + if (SV_RunThink (ent) && runmove[i]) + SV_Physics_Toss (ent); break; case MOVETYPE_FLY: - if (i > 0 && i <= svs.maxclients) + if (SV_RunThink (ent) && runmove[i]) { - if (SV_RunThink (ent)) + if (i > 0 && i <= svs.maxclients) { SV_CheckWater (ent); SV_WalkMove (ent); } + else + SV_Physics_Toss (ent); } - else - SV_Physics_Toss (ent); break; default: Host_Error ("SV_Physics: bad movetype %i", (int)ent->v->movetype); -- 2.39.2