Skip to content

Pass return value to WeaponSwitchPost, WeaponCanUsePost, WeaponCanSwitchToPost #2532

Open

Description

@SCP-076

SDKHook_ReloadPost already passes the engine function's return value into the callback:
void OnReloadPost(int weapon, bool bSuccess)

The following hooks also return meaningful bool values, but their Post callbacks do not expose them:
SDKHook_WeaponSwitchPost
SDKHook_WeaponCanUsePost
SDKHook_WeaponCanSwitchToPost

Plugins need the real outcome e.g., whether a weapon switch actually succeeded. Adding the return value as an extra callback parameter, consistent with ReloadPost, would cover this cleanly.

@Kenzzer this might be a quick addition during the khook migration, or I'm happy to submit a PR once that branch lands.

Activity

  1. Kenzzer commented on Aug 3, 2026

    @Kenzzer
    Member

    @Kenzzer this might be a quick addition during the khook migration, or I'm happy to submit a PR once that branch lands.

    I can shoulder the work, I rebase the branch every now and then so it's no biggie. But thank you for considering it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions