-
-
Notifications
You must be signed in to change notification settings - Fork 451
Allow custom sort natives and callback use optional data #1124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Allow custom sort natives and callback use optional data #1124
Conversation
This PR will break older plugins because of SP bug (alliedmodders/sourcepawn#684) |
Updated as Using |
Egh pull request reverted, don't even know myself if it's worth for me to update this to bring back the |
Updated branch to latest, restored |
323 main things done withSortCustom1D
,SortCustom2D
, andArrayList.SortCustom
natives:any
variable to custom sort rather than limited toint
. Meaning floats, enums, methodmap etc can be used to pass and custom sort.Merged from Update sourcepawn submodule #2146Handle hndl
pass toany data
, and not required in callback params. I don't see anywhere on why it should be limited to handles, so allowany
without needing to create new handles. Also updated core to usecell_t
data, doesn't make any difference but may well then do it.ArrayList
instead ofHandle
inSortFuncADTArray
callback.Handle
variable can still be used from old plugins.Only thing missing is
any
for regular 1D sorting. I'm not sure if it a good idea to allowany
inSortIntegers
native to sort enums, but i left it untouched.SortADTArrayCustom
also left untouched because we haveArrayList.SortCustom
traditional syntax instead.Hopefully i didn't miss anything that would break old plugins, but please do let me know if i did break one.
Compiled with this, no warnings and tested.