summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-24 15:05:28 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-24 15:05:28 -0400
commit90f7bc9aae01b3515bb52b2d6331d9820ac0989e (patch)
treecd24caed8aeabac027cfabe0225a50e6783c0fa7
parent430c88fa3facb51648c6a395b030bd8a5cc3e0ae (diff)
downloadtmwa-16.4.24.1.tar.gz
tmwa-16.4.24.1.tar.bz2
tmwa-16.4.24.1.tar.xz
tmwa-16.4.24.1.zip
always return a value in builtin_getv16.4.24.1
-rw-r--r--src/map/script-fun.cpp8
1 files changed, 8 insertions, 0 deletions
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<CharId>(num)))) != nullptr)
id = p_sd->bl_id;
else
+ {
+ push_int<ScriptDataInt>(st->stack, -1);
return;
+ }
}
else
+ {
+ push_int<ScriptDataInt>(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<ScriptDataInt>(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<ScriptDataInt>(st->stack, 0);
return;
}