mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
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:
parent
ae1a1df02d
commit
81059aee1d
1 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue