From 79aa56c704ff4117511cd33be3efd0321683d89a Mon Sep 17 00:00:00 2001 From: Kpy! Date: Tue, 21 Apr 2015 13:48:25 +0200 Subject: Fix script function return always removing references from NPC variables. Bugreport:8642 http://hercules.ws/board/tracker/issue-8642-script-engine-issue-quo/ --- src/map/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index ed9345678..b355dfa9e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -5703,7 +5703,7 @@ BUILDIN(return) { if( !st->script->local.arrays ) st->script->local.arrays = idb_alloc(DB_OPT_BASE); data->ref->arrays = st->script->local.arrays; - } else if ( name[0] == '.' /* && data->ref != NULL */ ) { + } else if ( name[0] == '.' && data->ref->vars == st->stack->stack_data[st->stack->defsp-1].u.ri->script->local.vars ) { data->ref = NULL; // Reference to the parent scope's script, remove reference pointer. } } -- cgit v1.2.3-70-g09d2