Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: KickBack function extension #980

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented Aug 1, 2024

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).

@s1lentq s1lentq merged commit c48be87 into rehlds:master Aug 6, 2024
4 checks passed
jonathan-up added a commit to jonathan-up/ReGameDLL_CS that referenced this pull request Aug 11, 2024
* Update workflows/build.yml
Fix temporarily testdemos

* Fix compiler warnings

* Fixed a bug in spectator move with no apply friction when stopped

* Update build.yml

* Add support IN_RUN key for +speed button in spectator/noclip and walk moves
Add cheat impulse for enable Noclip with air accelerate

* try fix a crash due to the deletion of an item in an unusual way
related rehlds#870, rehlds#752, rehlds#924, rehlds#957

* Extend KickBack functionalities (rehlds#980)

---------

Co-authored-by: s1lentq <[email protected]>
Co-authored-by: Francisco Muñoz <[email protected]>
@dystopm dystopm deleted the kickback_extension branch August 13, 2024 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants