mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Hotfix for 100% deadzone returning 0 input
It makes more sense for 100% deadzone to just make it so that you have to push the axis all the way to trigger it, rather than 100% deadzone resulting in no axis input ever happening... So, let's make it be the former way instead
This commit is contained in:
parent
27e084a827
commit
df220aa2c2
1 changed files with 10 additions and 5 deletions
|
@ -1045,7 +1045,11 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone)
|
|||
const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT;
|
||||
INT32 deadzoneAppliedValue = 0;
|
||||
|
||||
if (jdeadzone > 0 && magnitude > jdeadzone && deadZone < FRACUNIT)
|
||||
if (jdeadzone > 0 && magnitude > jdeadzone)
|
||||
{
|
||||
if (deadZone >= FRACUNIT) // If the deadzone value is at 100%...
|
||||
return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0
|
||||
else
|
||||
{
|
||||
INT32 adjustedMagnitude = abs(magnitude);
|
||||
adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE);
|
||||
|
@ -1054,6 +1058,7 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone)
|
|||
|
||||
deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone);
|
||||
}
|
||||
}
|
||||
|
||||
return deadzoneAppliedValue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue