From 48c06a98b3367aafb3388d3e65ce0d662ef8bc53 Mon Sep 17 00:00:00 2001 From: gumi Date: Mon, 29 Jan 2018 22:02:24 -0500 Subject: fix the nullpo check in builtin_getcharid --- src/map/script-fun.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/map') 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(st->stack, -1); + return; + } if (num == 0) push_int(st->stack, unwrap(sd->status_key.char_id)); -- cgit v1.2.3-70-g09d2