From 349c2b7ab74dd4704b9ec6bef322447fdc0efed9 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 6 Nov 2020 15:47:11 +0000 Subject: [PATCH] Perform an initial trace to the position of the gun, potential fix for rockets getting stuck in walls --- .gitlab-ci.yml | 2 +- qcsrc/server/weapons/tracing.qc | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f2fd4f2f..8c878258c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ test_sv_game: - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache - make - - EXPECT=040aeef53953a85c5891c0c39cf9860f + - EXPECT=35117dbed178a88ab65576740023dc4b - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg | tee /dev/stderr | grep '^:' diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 4db498b4a..b345b0984 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -72,10 +72,18 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect vector md = ent.(weaponentity).movedir; vector vecs = ((md.x > 0) ? md : '0 0 0'); - // TODO this is broken - see 637056bea7bf7f5c9c0fc6113e94731a2767476 for an attempted fix - // which fixes issue #1957 but causes #2129 vector dv = right * -vecs.y + up * vecs.z; - w_shotorg = ent.origin + ent.view_ofs + dv; + w_shotorg = ent.origin + ent.view_ofs; + if(antilag) + { + if(CS(ent).antilag_debug) + tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent, CS(ent).antilag_debug); + else + tracebox_antilag(ent, w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent)); + } + else + tracebox(w_shotorg, mi, ma, w_shotorg + dv, MOVE_NORMAL, ent); + w_shotorg = trace_endpos; // now move the shotorg forward as much as requested if possible if(antilag) -- 2.39.2