summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-28 15:13:02 +0100
committerHaru <haru@dotalux.com>2016-01-06 15:17:44 +0100
commit0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be (patch)
treea10d3acba71b7dfd643c3bfcd626fb2f592c2335 /src/map/npc.c
parent5db8be91c0e1b256a3c9d615ede2957218e69d3a (diff)
downloadhercules-0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be.tar.gz
hercules-0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be.tar.bz2
hercules-0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be.tar.xz
hercules-0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be.zip
Replaced some explicit casts with BL_UCAST
- Replaced safe casts (bl type already checked) Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c9
1 files changed, 4 insertions, 5 deletions
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);