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: CSPlayerWeapon integration + new members and functions #850

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented Jul 17, 2023

  • Added CSPlayerWeapon.cpp file to compile list
  • m_bHasSecondaryAttack member refactory:
    • Member name changed to m_iStateSecondaryAttack
    • Member type changed to uint8_t which has same size of bool but allows more values than true or false (this wont break API compatibility)
    • Changed logic inside CBasePlayerWeapon::HasSecondaryAttack to correctly alter function return based on m_iStateSecondaryAttack, which can be (0) no value / null (1) set (2) block
    • Removed logic in CBasePlayerWeapon::Spawn that caches the return value of CBasePlayerWeapon::HasSecondaryAttack, as this can only be overridden when set, rather than always
  • Added 5 callable functions from CSPlayerWeapon method:
    • DefaultDeploy
    • DefaultReload
    • DefaultShotgunReload
    • KickBack
    • SendWeaponAnim

@dystopm dystopm closed this Jul 17, 2023
@dystopm dystopm deleted the csplayer-new-members branch July 17, 2023 03:53
@dystopm dystopm restored the csplayer-new-members branch July 17, 2023 03:56
@dystopm dystopm deleted the csplayer-new-members branch July 17, 2023 03:56
@dystopm dystopm restored the csplayer-new-members branch July 17, 2023 03:57
@dystopm dystopm reopened this Jul 17, 2023
regamedll/dlls/weapons.cpp Outdated Show resolved Hide resolved
@dystopm dystopm marked this pull request as draft July 17, 2023 15:14
- Member name changed to m_iStateSecondaryAttack
- Member type changed to uint8_t which has same size of bool but allows more values than true or false (this wont break API compatibility)
- Moved logic inside HasSecondaryAttack to correctly alter function return based on m_iStateSecondaryAttack, which can be (0) no value / null (1) set (2) block
-Removed logic in CBasePlayerWeapon::Spawn that caches the return value of HasSecondaryAttack, as this can only be overridden when set, rather than always
@dystopm dystopm marked this pull request as ready for review July 17, 2023 16:28
Undone indents in switch
@s1lentq s1lentq merged commit 53d26a7 into rehlds:master Aug 23, 2023
4 checks passed
@dystopm dystopm deleted the csplayer-new-members branch October 11, 2023 15:09
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