summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-03-11 17:23:20 -0300
committershennetsind <ind@henn.et>2014-03-11 17:23:20 -0300
commit571d9e25008d8b386e28d7f1fd02f2690edf1f8c (patch)
tree278224551f274dc7befddc152ed6c7a57bfea95b /src
parent44819f75ab08b78ed7d09d3bbae0dc78a63aca52 (diff)
downloadhercules-571d9e25008d8b386e28d7f1fd02f2690edf1f8c.tar.gz
hercules-571d9e25008d8b386e28d7f1fd02f2690edf1f8c.tar.bz2
hercules-571d9e25008d8b386e28d7f1fd02f2690edf1f8c.tar.xz
hercules-571d9e25008d8b386e28d7f1fd02f2690edf1f8c.zip
Fixed getvariableofnpc
Would crash when target npc's variable database is empty. Special Thanks to Haruna, ossi0110 Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c3
1 files changed, 3 insertions, 0 deletions
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;
}