summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-24 23:18:08 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-24 23:18:08 +0000
commit50af381687c3a2e866f131368f48eb760cd40d9e (patch)
treea9d4bad19dcf351cb8a939b9a638324933b30714 /src/map/unit.c
parent3731a2ee949a424941f46a653525fcd4bfca0e3f (diff)
downloadhercules-50af381687c3a2e866f131368f48eb760cd40d9e.tar.gz
hercules-50af381687c3a2e866f131368f48eb760cd40d9e.tar.bz2
hercules-50af381687c3a2e866f131368f48eb760cd40d9e.tar.xz
hercules-50af381687c3a2e866f131368f48eb760cd40d9e.zip
* Added temporary code to track and prevent the multiple remove_map's that appear to be happening.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12430 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 5bdccd83d..afcd999b8 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1689,8 +1689,19 @@ int unit_remove_map(struct block_list *bl, int clrtype)
party_send_dot_remove(sd);//minimap dot fix [Kevin]
guild_send_dot_remove(sd);
+ if( map[bl->m].users <= 0 || sd->state.debug_remove_map )
+ {// this is only place where map users is decreased, if the mobs were removed too soon then this function was executed too many times [FlavioJS]
+ ShowDebug("unit_remove_map: unexpected state when removing player AID/CID:%d/%d"
+ " (active=%d connect_new=%d rewarp=%d changemap=%d debug_remove_map=%d)"
+ " from map=%s (users=%d). Please report this!!!\n",
+ sd->status.account_id, sd->status.char_id,
+ sd->state.active, sd->state.connect_new, sd->state.rewarp, sd->state.changemap, sd->state.debug_remove_map,
+ map[bl->m].name, map[bl->m].users);
+ }
+ else
if (--map[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex]
map_removemobs(bl->m);
+ sd->state.debug_remove_map = 1; // temporary state to track double remove_map's [FlavioJS]
break;
}