diff options
author | gumi <git@gumi.ca> | 2018-07-25 14:12:36 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-07-25 14:13:45 -0400 |
commit | ac30e506304c3e31805cbea313faac1d7625fdbb (patch) | |
tree | 2e718e830f06d0ca400ff83d294b98d6c7d68bd2 /src/map/script.c | |
parent | 67b1035c8fc0211dcbc9569c9de0ff4a774a69d7 (diff) | |
download | hercules-ac30e506304c3e31805cbea313faac1d7625fdbb.tar.gz hercules-ac30e506304c3e31805cbea313faac1d7625fdbb.tar.bz2 hercules-ac30e506304c3e31805cbea313faac1d7625fdbb.tar.xz hercules-ac30e506304c3e31805cbea313faac1d7625fdbb.zip |
bake sprintf into debugmes
Diffstat (limited to 'src/map/script.c')
-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 24d03bbe2..7440c7c05 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12349,9 +12349,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; } @@ -24872,7 +24881,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"), |