Add LookScale variable on weapon

This variable allows a weapon to set a custom look sensitivity multiplier without fiddling with FOVScale / DesiredFOV hacks.
This commit is contained in:
Sterling Parker 2019-03-06 23:25:09 -07:00 committed by Christoph Oelckers
commit ae1a1df02d
3 changed files with 3 additions and 0 deletions

View file

@ -757,6 +757,7 @@ static int LookAdjust(int look)
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.
{
look = int(look * scale);