summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-29 16:33:55 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-29 16:33:55 +0000
commit180c7942243c1b1a4a1d01f8f630126b25252e95 (patch)
treed224c4617465cce047091332cdedd703bfd4f027 /src/map/map.c
parent12ca43bf1123acb96fdc2c8f3a0003d79774bd19 (diff)
downloadhercules-180c7942243c1b1a4a1d01f8f630126b25252e95.tar.gz
hercules-180c7942243c1b1a4a1d01f8f630126b25252e95.tar.bz2
hercules-180c7942243c1b1a4a1d01f8f630126b25252e95.tar.xz
hercules-180c7942243c1b1a4a1d01f8f630126b25252e95.zip
Yet another performance improvement: Shut Down processing is now about to 7 times faster.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16006 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 0ce364c69..deb8548b0 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3533,7 +3533,7 @@ int cleanup_sub(struct block_list *bl, va_list ap)
map_quit((struct map_session_data *) bl);
break;
case BL_NPC:
- npc_unload((struct npc_data *)bl,true);
+ npc_unload((struct npc_data *)bl,false);
break;
case BL_MOB:
unit_free(bl,CLR_OUTSIGHT);
@@ -3571,21 +3571,23 @@ void do_final(void)
ShowStatus("Terminating...\n");
+ //Ladies and babies first.
+ iter = mapit_getallusers();
+ for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
+ map_quit(sd);
+ mapit_free(iter);
+
+ /* prepares npcs for a faster shutdown process */
+ do_clear_npc();
+
// remove all objects on maps
- for (i = 0; i < map_num; i++)
- {
+ for (i = 0; i < map_num; i++) {
ShowStatus("Cleaning up maps [%d/%d]: %s..."CL_CLL"\r", i+1, map_num, map[i].name);
if (map[i].m >= 0)
map_foreachinmap(cleanup_sub, i, BL_ALL);
}
ShowStatus("Cleaned up %d maps."CL_CLL"\n", map_num);
- //Scan any remaining players (between maps?) to kick them out. [Skotlex]
- iter = mapit_getallusers();
- for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
- map_quit(sd);
- mapit_free(iter);
-
id_db->foreach(id_db,cleanup_db_sub);
chrif_char_reset_offline();
chrif_flush_fifo();