Extend WeaponSwitch/Use callbacks - #2535
Conversation
| // WeaponSwitch | ||
| function Action (int client, int weapon); | ||
|
|
||
| // WeaponCanSwitchToPost |
There was a problem hiding this comment.
The documentation should be updated to nudge developers to use the improved version, so the three hooks can be removed form the signature?
There was a problem hiding this comment.
Like adding a short comment why using the callback definition below is preferrable ?
There was a problem hiding this comment.
I even thought it's ok to remove them from this one and only have them with the one with the bool success parameter.
But looking at how it was handled with other callbacks, specifically OnTakeDamage, before, we should keep it but add a comment that that parameter was an addition to sourcemod and add a proper feature provider so plugins can know whether that parameter is there or not at runtime for backwards compatibility.
Fullfill feature request #2532
It is indeed odd for sdkhooks to expose the return value of one post callback (weaponreload) but not weaponswitch/use. Let's correct that.