- SW: Fix issues with sector object machine guns in InitSobjMachineGun() following changes in 6476430be6.

* Needed to account for rebase of horizon re-centering from 100 to 0.
* Horizon value here is only for projectile's z and not the player's z.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=70199&p=1168858.
This commit is contained in:
Mitchell Richters 2020-10-12 13:06:21 +11:00
parent b4a011300a
commit 1109a90273

View file

@ -18561,11 +18561,12 @@ InitSobjMachineGun(short SpriteNum, PLAYERp pp)
}
else
{
auto horizmin = 75;
if (pp->horizon.horiz.asbuild() < horizmin)
pp->horizon.settarget(horizmin);
fixed_t q16horiz = pp->horizon.horiz.asq16();
fixed_t horizmin = IntToFixed(-25);
if (q16horiz < horizmin)
q16horiz = horizmin;
daz = -mulscale16(pp->horizon.horiz.asq16(), 2000) + (RANDOM_RANGE(Z(80)) - Z(40));
daz = -mulscale16(q16horiz, 2000) + (RANDOM_RANGE(Z(80)) - Z(40));
daang = sp->ang;
}