From 60366d298eaede6b2e3d160d6ddb244ab2943446 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 11 Nov 2022 21:10:41 +1100 Subject: [PATCH] - Duke: Use player's pitch sine rather than tangent when throwing a pipebomb while crouched. * Maintains the feel of the weapon by having the pipebomb roll along the ground. * Sign of sine is correct and allows for an expected throw behavior when looking up/down unlike original code. * Prevents an infinite tangent value from messing things up. --- source/games/duke/src/player_d.cpp | 2 +- source/games/duke/src/player_r.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 1953f164a..5a68f661e 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2199,7 +2199,7 @@ static void operateweapon(int snum, ESyncBits actions) if (p->on_ground && (actions & SB_CROUCH)) { vel = 15/16.; - zvel = p->horizon.sum().Tan() * 10.; + zvel = p->horizon.sum().Sin() * 10.; } else { diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index aa40d68bd..1095acb03 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -2699,7 +2699,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) if (p->on_ground && (actions & SB_CROUCH)) { vel = 15 / 16.; - zvel = p->horizon.sum().Tan() * 10.; + zvel = p->horizon.sum().Sin() * 10.; } else {