Skip to content

API: KickBack function extension#980

Merged
s1lentq merged 1 commit intorehlds:masterfrom
dystopm:kickback_extension
Aug 6, 2024
Merged

API: KickBack function extension#980
s1lentq merged 1 commit intorehlds:masterfrom
dystopm:kickback_extension

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
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
yohimik pushed a commit to yohimik/ReGameDLL_CS that referenced this pull request Jun 5, 2025
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