summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-09 06:20:52 +0200
committerHaru <haru@dotalux.com>2014-05-09 07:40:43 +0200
commit581ff22b9bad7567a27980df31636f0c75ba5fc2 (patch)
tree83aed2830b805ad154c91623ace99452620bce8b /src/map
parent84c1d0dd15553df0b2b61c028ea9aead381e7115 (diff)
downloadhercules-581ff22b9bad7567a27980df31636f0c75ba5fc2.tar.gz
hercules-581ff22b9bad7567a27980df31636f0c75ba5fc2.tar.bz2
hercules-581ff22b9bad7567a27980df31636f0c75ba5fc2.tar.xz
hercules-581ff22b9bad7567a27980df31636f0c75ba5fc2.zip
Added support to return a different exit status to the OS.
- This can be easily used by plugins. - See an example at http://github.com/HerculesWS/StaffPlugins/Haru/script_mapquit Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.c5
-rw-r--r--src/map/map.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/map/map.c b/src/map/map.c
index d8663fb70..a5ec6d83b 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5228,8 +5228,7 @@ int cleanup_db_sub(DBKey key, DBData *data, va_list va) {
/*==========================================
* map destructor
*------------------------------------------*/
-void do_final(void)
-{
+int do_final(void) {
int i;
struct map_session_data* sd;
struct s_mapiterator* iter;
@@ -5324,6 +5323,7 @@ void do_final(void)
HPM->event(HPET_POST_FINAL);
ShowStatus("Finished.\n");
+ return map->retval;
}
int map_abort_sub(struct map_session_data* sd, va_list ap) {
@@ -5865,6 +5865,7 @@ void map_defaults(void) {
/* */
map->minimal = false;
map->count = 0;
+ map->retval = EXIT_SUCCESS;
sprintf(map->db_path ,"db");
sprintf(map->help_txt ,"conf/help.txt");
diff --git a/src/map/map.h b/src/map/map.h
index 7373b516d..6b2e9d909 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -805,6 +805,7 @@ struct map_interface {
/* vars */
bool minimal;
+ int retval;
int count;
int autosave_interval;