From 7941f3cde39e6ab95b7e29489fce4394b0b6ec26 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 11 Oct 2022 15:10:30 +1100 Subject: [PATCH] - Duke: Pitch-adjusted velocity for `aim()`. --- source/games/duke/src/player.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index fb49933f0..131f39388 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -244,10 +244,11 @@ DDukeActor* aim(DDukeActor* actor, int abase) // This is a reimplementation of how it was solved in RedNukem. if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI()) { - double zvel = plr->horizon.sum().Tan() * 16.; + double vel = 1024, zvel = 0; + setFreeAimVelocity(vel, zvel, plr->horizon.sum(), 16.); HitInfo hit{}; - hitscan(plr->pos.plusZ(4), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, zvel), hit, CLIPMASK1); + hitscan(plr->pos.plusZ(4), actor->sector(), DVector3(actor->spr.angle.ToVector() * vel, zvel), hit, CLIPMASK1); if (hit.actor() != nullptr) {