void sort_custom ( Object obj, String func )
Sort the array using a custom method and return reference to the array. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise. Note: you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
class MyCustomSorter:
static func sort(a, b):
if a[0] < b[0]:
return true
return false
Godot version:
cff89fc4e4f2ceb577b5f7a119d98cb22d41ea44
OS/device including version:
Win 7
Issue description:
After this commit: https://github.com/godotengine/godot/pull/22737 Godot can´t short an array with the system described in the documentation, a.k.a:
Error is in new line 261 in core/array.cpp and return exactly the error that this line introduce (*this).