]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
Set groundentity when sv_gameplayfix_downtracesupportsongroundflag detects a floor
[xonotic/darkplaces.git] / sv_phys.c
index 5633a1d33a5d9c160b964f3b544bd73ec08a83c3..b26ebe225e90f6020e8411a7d6491565605a320b 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2350,7 +2350,11 @@ static void SV_WalkMove (prvm_edict_t *ent)
                VectorCopy(PRVM_serveredictvector(ent, maxs), entmaxs);
                trace = SV_TraceBox(upmove, entmins, entmaxs, downmove, type, ent, SV_GenericHitSuperContentsMask(ent), skipsupercontentsmask, skipmaterialflagsmask, collision_extendmovelength.value);
                if(trace.fraction < 1 && trace.plane.normal[2] > 0.7)
+               {
                        clip |= 1; // but we HAVE found a floor
+                       // set groundentity so we get carried when walking onto a mover with sv_gameplayfix_nogravityonground
+                       PRVM_serveredictedict(ent, groundentity) = PRVM_EDICT_TO_PROG(trace.ent);
+               }
        }
 
        // if the move did not hit the ground at any point, we're not on ground
@@ -3176,8 +3180,10 @@ void SV_Physics (void)
        PRVM_serverglobalfloat(frametime) = sv.frametime;
        prog->ExecuteProgram(prog, PRVM_serverfunction(StartFrame), "QC function StartFrame is missing");
 
+#ifdef USEODE
        // run physics engine
        World_Physics_Frame(&sv.world, sv.frametime, sv_gravity.value);
+#endif
 
 //
 // treat each object in turn