summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-03 20:56:20 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-03 20:56:20 +0000
commit50418d820226fbcdf7609fb619028e3b75a2fa9e (patch)
tree9eb6702bf55b75bcd5b340a1494fd89a1d279ed9 /src/map/unit.c
parenta05f029a4d7ebcdc9915c994f589bbca6f072004 (diff)
downloadhercules-50418d820226fbcdf7609fb619028e3b75a2fa9e.tar.gz
hercules-50418d820226fbcdf7609fb619028e3b75a2fa9e.tar.bz2
hercules-50418d820226fbcdf7609fb619028e3b75a2fa9e.tar.xz
hercules-50418d820226fbcdf7609fb619028e3b75a2fa9e.zip
Moved extra junk from map_addblock/map_delblock to where it logically belongs (loadendack/unit_remove_map), removed flags and _sub macros
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12002 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index c8ae55bc3..b1ee72a2f 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1652,7 +1652,10 @@ int unit_remove_map(struct block_list *bl, int clrtype)
skill_cleartimerskill(bl); // タイマースキルクリア
}
- if(bl->type == BL_PC) {
+ switch( bl->type )
+ {
+ case BL_PC:
+ {
struct map_session_data *sd = (struct map_session_data*)bl;
//Leave/reject all invitations.
@@ -1695,28 +1698,41 @@ int unit_remove_map(struct block_list *bl, int clrtype)
}
party_send_dot_remove(sd);//minimap dot fix [Kevin]
guild_send_dot_remove(sd);
- } else if(bl->type == BL_MOB) {
+
+ if (--map[bl->m].users == 0 && battle_config.dynamic_mobs) //[Skotlex]
+ map_removemobs(bl->m);
+
+ break;
+ }
+ case BL_MOB:
+ {
struct mob_data *md = (struct mob_data*)bl;
md->target_id=0;
md->attacked_id=0;
md->state.skillstate= MSS_IDLE;
- } else if (bl->type == BL_PET) {
+
+ break;
+ }
+ case BL_PET:
+ {
struct pet_data *pd = (struct pet_data*)bl;
- if(pd->pet.intimate <= 0 &&
- !(pd->msd && pd->msd->state.waitingdisconnect)
- ) { //If logging out, this is deleted on unit_free
+ if( pd->pet.intimate <= 0 && !(pd->msd && pd->msd->state.waitingdisconnect) )
+ { //If logging out, this is deleted on unit_free
clif_clearunit_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,0);
map_freeblock_unlock();
return 0;
}
- } else if (bl->type == BL_HOM) {
+
+ break;
+ }
+ case BL_HOM:
+ {
struct homun_data *hd = (struct homun_data *) bl;
ud->canact_tick = ud->canmove_tick; //It appears HOM do reset the can-act tick.
- if(!hd->homunculus.intimacy &&
- !(hd->master && hd->master->state.waitingdisconnect)
- ) { //If logging out, this is deleted on unit_free
+ if(!hd->homunculus.intimacy && !(hd->master && hd->master->state.waitingdisconnect) )
+ { //If logging out, this is deleted on unit_free
clif_emotion(bl, 28) ; //sob
clif_clearunit_area(bl,clrtype);
map_delblock(bl);
@@ -1724,7 +1740,12 @@ int unit_remove_map(struct block_list *bl, int clrtype)
map_freeblock_unlock();
return 0;
}
+
+ break;
}
+ default: ;// do nothing
+ }
+
clif_clearunit_area(bl,clrtype);
map_delblock(bl);
map_freeblock_unlock();