Awesome that you joined!
Indeed, the IF statements are for two reasons:
If the coefficient is 0, the FOV part of the formula changes since you can't divide by 0. The product of the zoom sensitivities (GstInput.SoldierZoomSensitivityAll * GstInput.SoldierZoomSensitivity#x##) has a lower limit of 0.1 and an upper limit of 3. This is a little counter-intuitive by the way, since they suddenly stop working. And it threw me off in the beginning.
Other than that, the formula is the base hipfire sensitivity, divided by the zoom sensitivities, then multiplied by the ratio between the base (configured) FOV and the aim FOV, where both FOV's are adjusted with the coefficient multiplied by an aspect ratio modifier.
What I have to "reverse engineer" now is the exact FOV of all the different aims. And I'll tell you, the sway makes it very tedious
If there is a list of what they are anywhere, that would be of great help!
I also need to reverse the formula, so any value can be calculated based on the other three values and a specific distance (counts).
This is exactly what I'm aiming to explain in this video:
And USA really does the job, with a lot of options!