summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/map.c b/src/map/map.c
index e3054fb30..0a0a09fcb 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2431,8 +2431,10 @@ void map_spawnmobs(int16 m) {
int map_removemobs_sub(struct block_list *bl, va_list ap)
{
- struct mob_data *md = (struct mob_data *)bl;
- nullpo_ret(md);
+ struct mob_data *md = NULL;
+ nullpo_ret(bl);
+ Assert_ret(bl->type == BL_MOB);
+ md = BL_UCAST(BL_MOB, bl);
//When not to remove mob:
// doesn't respawn and is not a slave
@@ -5332,10 +5334,10 @@ int cleanup_sub(struct block_list *bl, va_list ap) {
switch(bl->type) {
case BL_PC:
- map->quit((struct map_session_data *) bl);
+ map->quit(BL_UCAST(BL_PC, bl));
break;
case BL_NPC:
- npc->unload((struct npc_data *)bl,false);
+ npc->unload(BL_UCAST(BL_NPC, bl), false);
break;
case BL_MOB:
unit->free(bl,CLR_OUTSIGHT);
@@ -5347,7 +5349,7 @@ int cleanup_sub(struct block_list *bl, va_list ap) {
map->clearflooritem(bl);
break;
case BL_SKILL:
- skill->delunit((struct skill_unit *) bl);
+ skill->delunit(BL_UCAST(BL_SKILL, bl));
break;
}