diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index 3ba8ea9fc..19e6457bd 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4344,8 +4344,10 @@ BUILDIN(callfunc) { const char* name = reference_getname(data); if( name[0] == '.' ) { - ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1); - ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars); + if( !ref ) { + ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1); + ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars); + } data->ref = ref; } } |