summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-08-24 23:32:41 +0200
committerGitHub <noreply@github.com>2018-08-24 23:32:41 +0200
commitbf6b8a0ccfb3f0b35aec9b0ae833327ab5cbf405 (patch)
treee333b62318df2c0ed55ffc571ae83321e620909c /src/map/script.c
parentcc25a7c300ab2f549d4f2760eafb0baaf7e032d5 (diff)
parent5b62115128f5836d692b9b0305950a5ef7393306 (diff)
downloadhercules-bf6b8a0ccfb3f0b35aec9b0ae833327ab5cbf405.tar.gz
hercules-bf6b8a0ccfb3f0b35aec9b0ae833327ab5cbf405.tar.bz2
hercules-bf6b8a0ccfb3f0b35aec9b0ae833327ab5cbf405.tar.xz
hercules-bf6b8a0ccfb3f0b35aec9b0ae833327ab5cbf405.zip
Merge pull request #2146 from mekolat/debugmes
bake sprintf into debugmes
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c17
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"),