Skip to content

Instantly share code, notes, and snippets.

@tabularelf
Last active April 21, 2023 14:16
Show Gist options
  • Save tabularelf/c21c4f48ca3fd98e0e9d1a8cbb81c6a7 to your computer and use it in GitHub Desktop.
Save tabularelf/c21c4f48ca3fd98e0e9d1a8cbb81c6a7 to your computer and use it in GitHub Desktop.
function_execute
/// @func function_execute( function/method, [arguments_in_array])
/// @desc Executes a runtime function, GML function or method, respecting method rules.
/// @param function/method
/// @param [arguments_in_array]
function function_execute(_funcMethod, _args = undefined) {
gml_pragma("forceinline");
if (is_undefined(_args)) return _funcMethod();
return is_method(_funcMethod) ? method_call(_funcMethod, _args) : script_execute_ext(_funcMethod, _args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment