]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
[04:31:11] <@LordHavoc> div0: 9179 (if (msecdelta <= 0) return;) wrecked connect...
[xonotic/darkplaces.git] / sv_phys.c
index d9cb5e6b06e556985fcf48f27276bd6760ff37f3..24b17ef7bd77dfe0423eec84a8967acbb3f0fbc8 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -99,7 +99,7 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
        vec3_t hullmins, hullmaxs;
        int i, bodysupercontents;
        int passedictprog;
-       float pitchsign;
+       float pitchsign = 1;
        qboolean pointtrace;
        prvm_edict_t *traceowner, *touch;
        trace_t trace;
@@ -122,7 +122,7 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
        prvm_edict_t *touchedicts[MAX_EDICTS];
 #ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
        vec3_t end;
-       vec_t len;
+       vec_t len = 0;
 
        if(!VectorCompare(start, pEnd))
        {
@@ -241,7 +241,7 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
                        // if the modelindex is 0, it shouldn't be SOLID_BSP!
                        if (modelindex > 0 && modelindex < MAX_MODELS)
                                model = sv.models[(int)touch->fields.server->modelindex];
-                       pitchsign = 1;
+                       //pitchsign = 1;
                        if (
                                ((modelindex = (int)touch->fields.server->modelindex) >= 1 && modelindex < MAX_MODELS && (model = sv.models[(int)touch->fields.server->modelindex]))
                                ?
@@ -2035,7 +2035,8 @@ void SV_Physics_Toss (prvm_edict_t *ent)
                        // and groundentity is now freed, set groundentity to 0 (world)
                        // which leaves it suspended in the air
                        ent->fields.server->groundentity = 0;
-                       return;
+                       if (sv_gameplayfix_noairborncorpse_allowsuspendeditems.integer)
+                               return;
                }
        }
        ent->priv.server->suspendedinairflag = false;
@@ -2251,7 +2252,7 @@ static void SV_Physics_Entity (prvm_edict_t *ent)
        //  ents in the first frame regardless)
        qboolean runmove = ent->priv.server->move;
        ent->priv.server->move = true;
-       if (!runmove && sv_gameplayfix_delayprojectiles.integer)
+       if (!runmove && sv_gameplayfix_delayprojectiles.integer > 0)
                return;
        switch ((int) ent->fields.server->movetype)
        {
@@ -2487,9 +2488,17 @@ void SV_Physics (void)
 
        // run physics on all the non-client entities
        if (!sv_freezenonclients.integer)
+       {
                for (;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
                        if (!ent->priv.server->free)
                                SV_Physics_Entity(ent);
+               // make a second pass to see if any ents spawned this frame and make
+               // sure they run their move/think
+               if (sv_gameplayfix_delayprojectiles.integer < 0)
+                       for (i = svs.maxclients + 1, ent = PRVM_EDICT_NUM(i);i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
+                               if (!ent->priv.server->move && !ent->priv.server->free)
+                                       SV_Physics_Entity(ent);
+       }
 
        if (prog->globals.server->force_retouch > 0)
                prog->globals.server->force_retouch = max(0, prog->globals.server->force_retouch - 1);