Fix faulty multiplication logic for LookScale

Turns out the entire thing was getting shortcutted because FOVScale is 0 unless set explicitly or via A_ZoomFactor.
This commit is contained in:
Sterling Parker 2019-03-07 06:27:10 -07:00 committed by Christoph Oelckers
parent ae1a1df02d
commit 81059aee1d

View file

@ -756,11 +756,15 @@ static int LookAdjust(int look)
if (players[consoleplayer].playerstate != PST_DEAD && // No adjustment while dead.
players[consoleplayer].ReadyWeapon != NULL) // No adjustment if no weapon.
{
auto scale = players[consoleplayer].ReadyWeapon->FloatVar(NAME_FOVScale);
scale *= players[consoleplayer].ReadyWeapon->FloatVar(NAME_LookScale);
if (scale > 0) // No adjustment if it is non-positive.
auto FOVScale = players[consoleplayer].ReadyWeapon->FloatVar(NAME_FOVScale);
auto LookScale = players[consoleplayer].ReadyWeapon->FloatVar(NAME_LookScale);
if (FOVScale > 0) // No adjustment if it is non-positive.
{
look = int(look * scale);
look = int(look * FOVScale);
}
if (LookScale > 0) // No adjustment if it is non-positive.
{
look = int(look * LookScale);
}
}
return look;