From 25d84b190dda7d757f882f398a39e334e937f844 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 29 May 2022 00:24:40 +0700 Subject: [PATCH] fix beta bfg from SMMU (#568) --- Source/p_pspr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/p_pspr.c b/Source/p_pspr.c index db04bd7c..97dfc974 100644 --- a/Source/p_pspr.c +++ b/Source/p_pspr.c @@ -789,7 +789,13 @@ void A_FireOldBFG(player_t *player, pspdef_t *psp) } while (mask && (mask=0, !linetarget)); // killough 8/2/98 an1 += an - mo->angle; - an2 += tantoangle[slope >> DBITS]; + // sf: despite killough's infinite wisdom.. even + // he is prone to mistakes. seems negative numbers + // won't survive a bitshift! + if (slope < 0) + an2 -= tantoangle[-slope >> DBITS]; + else + an2 += tantoangle[slope >> DBITS]; } th = P_SpawnMobj(mo->x, mo->y,