summaryrefslogtreecommitdiff
path: root/src/map/script-fun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r--src/map/script-fun.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 9d4b8f6..92c2f0d 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -1996,7 +1996,10 @@ void builtin_getcharid(ScriptState *st)
else
sd = script_rid2sd(st);
- nullpo_retv(sd);
+ if (sd == nullptr) {
+ push_int<ScriptDataInt>(st->stack, -1);
+ return;
+ }
if (num == 0)
push_int<ScriptDataInt>(st->stack, unwrap<CharId>(sd->status_key.char_id));