Set groundentity when sv_gameplayfix_downtracesupportsongroundflag detects a floor
[xonotic/darkplaces.git] / sv_phys.c
index a918ea25603c7145aa59e09174643011a5e22152..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