Skip to content

Pass return value to WeaponSwitchPost, WeaponCanUsePost, WeaponCanSwitchToPost #2532

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.

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