From 0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 28 Dec 2015 15:13:02 +0100 Subject: Replaced some explicit casts with BL_UCAST - Replaced safe casts (bl type already checked) Signed-off-by: Haru --- src/map/npc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 11e4da147..6d495e531 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1637,10 +1637,9 @@ void npc_trader_update(int master) { iter = db_iterator(map->id_db); for (bl = dbi_first(iter); dbi_exists(iter); bl = dbi_next(iter)) { - if( bl->type == BL_NPC ) { - struct npc_data* nd = (struct npc_data*)bl; - - if( nd->src_id == master ) { + if (bl->type == BL_NPC) { + struct npc_data *nd = BL_UCAST(BL_NPC, bl); + if (nd->src_id == master) { nd->u.scr.shop = master_nd->u.scr.shop; } } @@ -4679,7 +4678,7 @@ int npc_reload(void) { switch(bl->type) { case BL_NPC: if( bl->id != npc->fake_nd->bl.id )// don't remove fake_nd - npc->unload((struct npc_data *)bl, false); + npc->unload(BL_UCAST(BL_NPC, bl), false); break; case BL_MOB: unit->free(bl,CLR_OUTSIGHT); -- cgit v1.2.3-70-g09d2