From 7ea07939bef0cbe85c54d9f68cb924198b0b1f64 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 9 Jan 2022 21:31:12 +1000 Subject: [PATCH] Set groundentity when sv_gameplayfix_downtracesupportsongroundflag detects a floor Fixes movers not carrying players who walk onto them with no z velocity, when sv_gameplayfix_nogravityonground is enabled Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/22 sv_gameplayfix_nogravityonground 1 prevents movers from detecting players #22 Signed-off-by: bones_was_here --- sv_main.c | 2 +- sv_phys.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sv_main.c b/sv_main.c index ba0c5d52..c39069eb 100644 --- a/sv_main.c +++ b/sv_main.c @@ -122,7 +122,7 @@ cvar_t sv_gameplayfix_stepmultipletimes = {CF_SERVER, "sv_gameplayfix_stepmultip cvar_t sv_gameplayfix_nostepmoveonsteepslopes = {CF_SERVER, "sv_gameplayfix_nostepmoveonsteepslopes", "0", "crude fix which prevents MOVETYPE_STEP (not swimming or flying) to move on slopes whose angle is bigger than 45 degree"}; cvar_t sv_gameplayfix_swiminbmodels = {CF_SERVER, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"}; cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {CF_SERVER, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"}; -cvar_t sv_gameplayfix_downtracesupportsongroundflag = {CF_SERVER, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps)"}; +cvar_t sv_gameplayfix_downtracesupportsongroundflag = {CF_SERVER, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps), fixes groundentity not being set when walking onto a mover with sv_gameplayfix_nogravityonground"}; cvar_t sv_gameplayfix_q1bsptracelinereportstexture = {CF_SERVER, "sv_gameplayfix_q1bsptracelinereportstexture", "1", "enables mods to get accurate trace_texture results on q1bsp by using a surface-hitting traceline implementation rather than the standard solidbsp method, q3bsp always reports texture accurately"}; cvar_t sv_gameplayfix_unstickplayers = {CF_SERVER, "sv_gameplayfix_unstickplayers", "1", "big hack to try and fix the rare case of MOVETYPE_WALK entities getting stuck in the world clipping hull."}; cvar_t sv_gameplayfix_unstickentities = {CF_SERVER, "sv_gameplayfix_unstickentities", "1", "hack to check if entities are crossing world collision hull and try to move them to the right position"}; diff --git a/sv_phys.c b/sv_phys.c index a918ea25..b26ebe22 100644 --- 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 -- 2.39.2