Skip to content

Extend handler flags to have handler_first and handler_last for registered callback and similar that uses the handler flags. #66

@knryuu

Description

@knryuu

As discussed on Discord, IS4 said about extending handler flags to have handler_first and handler_last for the "hook order", since the current order depends on you calling the function.

For example:

pawn_register_callback("OnPlayerConnect", "FirstCall");
pawn_register_callback("OnPlayerConnect", "SecondCall");
// ...

Extending the flag to support explicit calling will make sure the function works as the developer intended.
Supposed you want to hook the OnPlayerConnect callback but you want that to be called at the very last, with the new flag you can just do this:

pawn_reigster_callback("OnPlayerConnect", "ResetVariable", handler_last);

This will ensure the ResetFunction gets called last, no matter where you place the function register calls.

The same goes with handler_first:

pawn_reigster_callback("OnPlayerConnect", "PrepareVariable", handler_first);

This function will make sure the PrepareVariable gets called first, no matter where you place the function register calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions