summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
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();