This modification extends the usage and hooking of the CBasePlayerWeapon::KickBack function which handles recoil control. In summary, the changes made were:
Punchangle boundary fix: If your punchangles are already in a high value, shooting will clamp punchangle according to the lateral/up max angle value. This PR fixes that by ignoring if already having punchangle in an out-of-boundary value.
KickBack params expanded: You can not force a lateral or up max angle value, or force a direction change probability.
By the mentioned points:
Now every weapon uses KickBack. All other weapons just punches vertically, so KickBack needed a readjustment for those basic cases.
This is useful for API consumption and event handling, so you can alter/handle every weapon recoil in a simple way.
There's already a way to use and hook KickBack in reapi, so it will be easy to extend and implement your own custom weapons.
The following modification maintains a very low probability of altering the original firing behavior, just in very, VERY specific cases (which are highly related to 3rd party plugins).
This modification extends the usage and hooking of the
CBasePlayerWeapon::KickBack
function which handles recoil control. In summary, the changes made were:KickBack
params expanded: You can not force a lateral or up max angle value, or force a direction change probability.By the mentioned points:
KickBack
. All other weapons just punches vertically, soKickBack
needed a readjustment for those basic cases.