summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 16:09:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 16:09:13 +0000
commite07b2da8d90f955dbe01737e9bfdb73ddaa3bd83 (patch)
tree2b7773b750e46c8356556a11944f166f3fbbe627 /src/map/map.c
parent7ab2575a4a3499c642e315d860c82fed60e3d9bb (diff)
downloadhercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.gz
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.bz2
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.tar.xz
hercules-e07b2da8d90f955dbe01737e9bfdb73ddaa3bd83.zip
- Cleaned up a bit the code for @item
- Fixed character/storage being sent to be saved TWICE when you logged out while the storage is opened. - Added save_settings map config. Specifies after which events do characters get saved (defaults to all): 1 - Trade successful, 2 - Vending transaction, 4 - Closing storage/guild storage, 8 - hatching a pet. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7375 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 0270b509d..98af550c2 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -168,6 +168,7 @@ int map_num = 0;
int map_port=0;
int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
+int save_settings = 0xFFFF;
int charsave_method = 0; //Default 'OLD' Save method (SQL ONLY!) [Sirius]
int agit_flag = 0;
int night_flag = 0; // 0=day, 1=night [Yor]
@@ -1664,6 +1665,8 @@ int map_quit(struct map_session_data *sd) {
npc_timerevent_quit(sd);
if (sd->state.event_disconnect)
npc_script_event(sd, NPCE_LOGOUT);
+
+ sd->state.waitingdisconnect = 1;
if (sd->pd) unit_free(&sd->pd->bl);
unit_free(&sd->bl);
chrif_save(sd,1);
@@ -3306,6 +3309,8 @@ int map_config_read(char *cfgName) {
autosave_interval = atoi(w2) * 1000;
if (autosave_interval <= 0)
autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
+ } else if (strcmpi(w1, "save_settings") == 0) {
+ save_settings = atoi(w2);
} else if (strcmpi(w1, "motd_txt") == 0) {
strcpy(motd_txt, w2);
} else if (strcmpi(w1, "help_txt") == 0) {