From: bones_was_here Date: Mon, 27 Sep 2021 23:31:48 +0000 (+1000) Subject: Make stepping up while jumping reliable X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4c6cb7882855468365644ac65b6eb86a3e82a812;p=xonotic%2Fdarkplaces.git Make stepping up while jumping reliable When the player is hard up against a solid surface trying to climb up, they are blocked from gaining any significant speed by the solid, so the distance they could potentially move into the solid at that speed can be well under 0.03125 units, causing the step up to fail. The same can happen when the player is stepping up with less than 0.03125 units of distance left on their move, causing them to stop dead when climbing stairs at speed with sv_gameplayfix_stepmultipletimes 1. Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/8 Stepping up is unreliable #8 Signed-off-by: bones_was_here --- diff --git a/sv_phys.c b/sv_phys.c index a918ea25..eb04a6dc 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1303,7 +1303,8 @@ static int SV_FlyMove (prvm_edict_t *ent, float time, qbool applygravity, float } //Con_Printf("%f %f %f : ", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]); // accept the new position if it made some progress... - if (fabs(PRVM_serveredictvector(ent, origin)[0] - org[0]) >= 0.03125 || fabs(PRVM_serveredictvector(ent, origin)[1] - org[1]) >= 0.03125) + // previously this checked if absolute distance >= 0.03125 which made stepping up unreliable + if (PRVM_serveredictvector(ent, origin)[0] - org[0] || PRVM_serveredictvector(ent, origin)[1] - org[1]) { //Con_Printf("accepted (delta %f %f %f)\n", PRVM_serveredictvector(ent, origin)[0] - org[0], PRVM_serveredictvector(ent, origin)[1] - org[1], PRVM_serveredictvector(ent, origin)[2] - org[2]); trace = steptrace2;