summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/atcommand.c11
-rw-r--r--src/emap/atcommand.h11
-rw-r--r--src/emap/init.c1
3 files changed, 22 insertions, 1 deletions
diff --git a/src/emap/atcommand.c b/src/emap/atcommand.c
index b7acb4a..7c3f345 100644
--- a/src/emap/atcommand.c
+++ b/src/emap/atcommand.c
@@ -129,3 +129,14 @@ ACMD2(slide)
unit->movepos(&sd->bl, x, y, 1, 0);
return true;
}
+
+ACMD1(mapExit)
+{
+ int code = 0;
+ if (!*message || sscanf(message, "%5d", &code) < 1)
+ code = 0;
+
+ map->retval = code;
+ map->do_shutdown();
+ return true;
+}
diff --git a/src/emap/atcommand.h b/src/emap/atcommand.h
index fa40548..cd4cd41 100644
--- a/src/emap/atcommand.h
+++ b/src/emap/atcommand.h
@@ -9,9 +9,18 @@ const char* eatcommand_msgsd_pre(struct map_session_data **sdPtr,
const char* eatcommand_msgfd_pre(int *fdPtr,
int *msgPtr);
-#define ACMD2(x) bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command __attribute__ ((unused)), const char* message, struct AtCommandInfo *info)
+#define ACMD1(x) bool atcommand_ ## x (const int fd __attribute__ ((unused)), \
+ struct map_session_data* sd __attribute__ ((unused)), \
+ const char* command __attribute__ ((unused)), \
+ const char* message, struct AtCommandInfo *info __attribute__ ((unused)))
+#define ACMD2(x) bool atcommand_ ## x (const int fd, \
+ struct map_session_data* sd, \
+ const char* command __attribute__ ((unused)), \
+ const char* message, \
+ struct AtCommandInfo *info)
ACMD2(setSkill);
ACMD2(slide);
+ACMD1(mapExit);
#endif // EVOL_MAP_ATCOMMAND
diff --git a/src/emap/init.c b/src/emap/init.c
index 3442b26..8f2de51 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -88,6 +88,7 @@ HPExport void plugin_init (void)
addAtcommand("setskill", setSkill);
addAtcommand("slide", slide);
+ addAtcommand("mapexit", mapExit);
addScriptCommand("chatjoin", "i*", chatJoin);
addScriptCommand("setcamnpc", "*", setCamNpc);