summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-12-21 19:06:08 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-12-21 19:07:09 -0800
commit9316b28e655093547d397197f30173cfc51f8de8 (patch)
tree910f4b267e0ad9b40a3f58ecd49b5ac1f9110ae5
parent3eea219548e84efdbc3148ce378fcba865f97a01 (diff)
downloadtmwa-9316b28e655093547d397197f30173cfc51f8de8.tar.gz
tmwa-9316b28e655093547d397197f30173cfc51f8de8.tar.bz2
tmwa-9316b28e655093547d397197f30173cfc51f8de8.tar.xz
tmwa-9316b28e655093547d397197f30173cfc51f8de8.zip
Add mapexit as a script command
It's not safe to call GM commands without an attached player.
-rw-r--r--src/map/script.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index f3635c4..6e4d18d 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -16,6 +16,7 @@
#include "../io/lock.hpp"
#include "../io/read.hpp"
+#include "../common/core.hpp"
#include "../common/db.hpp"
#include "../common/extract.hpp"
#include "../common/intern-pool.hpp"
@@ -4164,6 +4165,13 @@ void builtin_getmap(ScriptState *st)
push_str(st->stack, ByteCode::CONSTSTR, dumb_string::fake(sd->bl_m->name_));
}
+static
+void builtin_mapexit(ScriptState *st)
+{
+ runflag = 0;
+}
+
+
//
// 実行部main
//
@@ -5151,5 +5159,6 @@ BuiltinFunction builtin_functions[] =
BUILTIN(getx, ""),
BUILTIN(gety, ""),
BUILTIN(getmap, ""),
+ BUILTIN(mapexit, ""),
{nullptr, ZString(), ZString()},
};