diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c index c40137c55..477d2ad98 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12361,9 +12361,18 @@ static BUILDIN(getstatus) *------------------------------------------*/ static BUILDIN(debugmes) { - const char *str; - str=script_getstr(st,2); - ShowDebug("script debug : %d %d : %s\n",st->rid,st->oid,str); + struct StringBuf buf; + StrBuf->Init(&buf); + + if (!script->sprintf_helper(st, 2, &buf)) { + StrBuf->Destroy(&buf); + script_pushint(st, 0); + return false; + } + + ShowDebug("script debug : %d %d : %s\n", st->rid, st->oid, StrBuf->Value(&buf)); + StrBuf->Destroy(&buf); + script_pushint(st, 1); return true; } @@ -25047,7 +25056,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(sc_end,"i?"), BUILDIN_DEF(getstatus, "i?"), BUILDIN_DEF(getscrate,"ii?"), - BUILDIN_DEF(debugmes,"v"), + BUILDIN_DEF(debugmes,"v*"), BUILDIN_DEF2(catchpet,"pet","i"), BUILDIN_DEF2(birthpet,"bpet",""), BUILDIN_DEF(resetlvl,"i"), |