From 571d9e25008d8b386e28d7f1fd02f2690edf1f8c Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 11 Mar 2014 17:23:20 -0300 Subject: Fixed getvariableofnpc Would crash when target npc's variable database is empty. Special Thanks to Haruna, ossi0110 Signed-off-by: shennetsind --- src/map/script.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index c2d9b2278..bba771a3c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15692,6 +15692,9 @@ BUILDIN(getvariableofnpc) return false; } + if( !nd->u.scr.script->local.vars ) + nd->u.scr.script->local.vars = i64db_alloc(DB_OPT_RELEASE_DATA); + script->push_val(st->stack, C_NAME, reference_getuid(data), &nd->u.scr.script->local); return true; } -- cgit v1.2.3-70-g09d2