From 63917fd158b71531d57eb5f9bfd361c362be13f2 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 11 Oct 2022 12:43:53 +1100 Subject: [PATCH] - Duke: Pitch-adjusted velocity for `shootknee()` when free-aiming. --- source/games/duke/src/player_d.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 263591951..5a6abd0da 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -228,12 +228,12 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang) { auto sectp = actor->sector(); - double zvel; + double vel = 1024., zvel; HitInfo hit{}; if (p >= 0) { - zvel = ps[p].horizon.sum().Tan() * 16.; + setFreeAimVelocity(vel, zvel, ps[p].horizon.sum(), 16.); pos.Z += 6; ang += DAngle1 * 2.64; } @@ -245,7 +245,7 @@ static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang) ang = (pactor->spr.pos.XY() - pos.XY()).Angle(); } - hitscan(pos, sectp, DVector3(ang.ToVector() * 1024, zvel * 64), hit, CLIPMASK1); + hitscan(pos, sectp, DVector3(ang.ToVector() * vel, zvel * 64), hit, CLIPMASK1); if (hit.hitSector == nullptr) return;