summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c20
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 2c85e39..de27f2c 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -225,6 +225,7 @@ HPExport void plugin_init (void)
addScriptCommand("homstatus","",homstatus);
addScriptCommand("readparam2","i?",readparam2);
addScriptCommand("npcshopattach","s?",npcshopattach);
+ addScriptCommand("debugmes","v*",debugmes);
do_init_langs();
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 26a2dd4..de5ba06 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2729,3 +2729,23 @@ BUILDIN(readparam2)
return true;
}
+/*==========================================
+ *
+ *------------------------------------------*/
+static BUILDIN(debugmes)
+{
+ 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;
+}
+
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index 04da908..8c29632 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -114,5 +114,6 @@ BUILDIN(deployhomunculus);
BUILDIN(recallhomunculus);
BUILDIN(homstatus);
BUILDIN(readparam2);
+BUILDIN(debugmes);
#endif // EVOL_MAP_SCRIPT_BUILDINS