Skip to content

Instantly share code, notes, and snippets.

@tinkerer-red
Last active January 28, 2025 02:00
Show Gist options
  • Save tinkerer-red/9ed172f0db46df862f0b667b9d27da72 to your computer and use it in GitHub Desktop.
Save tinkerer-red/9ed172f0db46df862f0b667b9d27da72 to your computer and use it in GitHub Desktop.
constructor_call() / constructor_call_ext()
function constructor_call(ind) {
static __arr = [];
var _i=1; repeat(argument_count-1) {
__arr = argument[_i];
_i++}
var _struct = constructor_call_ext(ind, __arr);
array_resize(__arr, 0)
return _struct;
}
function constructor_call_ext(ind, array, offset=0, num_args=array_length(array)-offset) {
var _struct = {};
with( _struct ) script_execute_ext(ind, array, offset, num_args);
static_set(_struct, static_get(ind))
return _struct
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment