From 9316b28e655093547d397197f30173cfc51f8de8 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 21 Dec 2013 19:06:08 -0800 Subject: Add mapexit as a script command It's not safe to call GM commands without an attached player. --- src/map/script.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/map') 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()}, }; -- cgit v1.2.3-60-g2f50