- 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.
This commit is contained in:
Mitchell Richters 2022-11-11 21:10:41 +11:00
parent cfb9ebf8e5
commit 60366d298e
2 changed files with 2 additions and 2 deletions

View file

@ -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
{

View file

@ -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
{