IS4Code / PawnPlus

A SA-MP plugin enhancing the capabilities of the Pawn programming language
MIT License
102 stars 17 forks source link

Add handler_inverted_return for callback handlers #52

Closed AGraber closed 2 years ago

AGraber commented 2 years ago

This handler checks if the return value is negative. If it is, it inverts the result and returns that as the return value, and other callbacks handlers and the base callback are not executed. This is behavior is identical to the one of y_hooks from YSI.

I want this so I can use it alongside AGraber/pawn-plus-hooks, so that it can be functionally identical to y_hooks but leveraging PawnPlus to implement it.