From: bones_was_here Date: Sun, 16 Jan 2022 20:45:18 +0000 (+1000) Subject: Merge MR 'Set groundentity when sv_gameplayfix_downtracesupportsongroundflag detects... X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=c573a47a538a3a90cb34ccf2e3e21a0d1b129d20;hp=f847004b9818defbfd4bf15fe7b891fee2706079 Merge MR '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 https://github.com/DarkPlacesEngine/darkplaces/pull/23 branch: bones_was_here/walking_groundentity_fix commits: 7ea07939bef0cbe85c54d9f68cb924198b0b1f64 Signed-off-by: bones_was_here --- diff --git a/sv_main.c b/sv_main.c index 8c10fcb0..8b5cfb84 100644 --- a/sv_main.c +++ b/sv_main.c @@ -123,7 +123,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