|
@@ -1243,6 +1243,12 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
|
|
bl->y = ud->to_y = y;
|
|
bl->y = ud->to_y = y;
|
|
bl->m = m;
|
|
bl->m = m;
|
|
|
|
|
|
|
|
+ if (bl->type == BL_NPC) {
|
|
|
|
+ TBL_NPC *nd = (TBL_NPC*)bl;
|
|
|
|
+ map_addnpc(m, nd);
|
|
|
|
+ npc_setcells(nd);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(map_addblock(bl))
|
|
if(map_addblock(bl))
|
|
return 4; //error on adding bl to map
|
|
return 4; //error on adding bl to map
|
|
|
|
|
|
@@ -3093,6 +3099,10 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ case BL_NPC:
|
|
|
|
+ if (npc_remove_map( (TBL_NPC*)bl ) != 0)
|
|
|
|
+ return 0;
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
break;// do nothing
|
|
break;// do nothing
|
|
}
|
|
}
|
|
@@ -3101,11 +3111,24 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
|
|
skill_unit_move(bl,gettick(),4);
|
|
skill_unit_move(bl,gettick(),4);
|
|
skill_cleartimerskill(bl);
|
|
skill_cleartimerskill(bl);
|
|
}
|
|
}
|
|
- // /BL_MOB is handled by mob_dead unless the monster is not dead.
|
|
|
|
- if( bl->type != BL_MOB || !status_isdead(bl) )
|
|
|
|
- clif_clearunit_area(bl,clrtype);
|
|
|
|
|
|
|
|
- map_delblock(bl);
|
|
|
|
|
|
+ switch (bl->type) {
|
|
|
|
+ case BL_NPC:
|
|
|
|
+ // already handled by npc_remove_map
|
|
|
|
+ break;
|
|
|
|
+ case BL_MOB:
|
|
|
|
+ // /BL_MOB is handled by mob_dead unless the monster is not dead.
|
|
|
|
+ if (status_isdead(bl)) {
|
|
|
|
+ map_delblock(bl);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ // Fall through
|
|
|
|
+ default:
|
|
|
|
+ clif_clearunit_area(bl, clrtype);
|
|
|
|
+ map_delblock(bl);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
map_freeblock_unlock();
|
|
map_freeblock_unlock();
|
|
|
|
|
|
return 1;
|
|
return 1;
|