From 90f7bc9aae01b3515bb52b2d6331d9820ac0989e Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 24 Apr 2016 15:05:28 -0400 Subject: always return a value in builtin_get --- src/map/script-fun.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index b73a8fc..c8d1af4 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -3818,10 +3818,16 @@ void builtin_get(ScriptState *st) if ((p_sd = map_nick2sd(map_charid2nick(wrap(num)))) != nullptr) id = p_sd->bl_id; else + { + push_int(st->stack, -1); return; + } } else + { + push_int(st->stack, -1); return; + } bl = map_id2bl(id); } @@ -3848,6 +3854,7 @@ void builtin_get(ScriptState *st) if (name_.startswith(".@"_s)) { PRINTF("builtin_get: illegal scope!\n"_fmt); + push_int(st->stack, 0); return; } NpcName name; @@ -3880,6 +3887,7 @@ void builtin_get(ScriptState *st) else { PRINTF("builtin_get: illegal scope !\n"_fmt); + push_int(st->stack, 0); return; } -- cgit v1.2.3-60-g2f50