From e3eac134b1607cfe78331e298aaa20b260662571 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 28 Dec 2015 15:41:36 +0100 Subject: Replaced the remaining explicit casts with BL_CAST/BL_UCAST Signed-off-by: Haru --- src/map/pc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 960001d37..2dfd9519b 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5261,15 +5261,13 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil int i,itemid,flag; double rate; struct status_data *sd_status, *md_status; - struct mob_data *md; + struct mob_data *md = BL_CAST(BL_MOB, bl); struct item tmp_item; struct item_data *data = NULL; - if(!sd || !bl || bl->type!=BL_MOB) + if (sd == NULL || md == NULL) return 0; - md = (struct mob_data *)bl; - if(md->state.steal_flag == UCHAR_MAX || ( md->sc.opt1 && md->sc.opt1 != OPT1_BURNING && md->sc.opt1 != OPT1_CRYSTALIZE ) ) //already stolen from / status change check return 0; @@ -5341,12 +5339,11 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil **/ int pc_steal_coin(struct map_session_data *sd, struct block_list *target) { int rate, skill_lv; - struct mob_data *md; + struct mob_data *md = BL_CAST(BL_MOB, target); - if (!sd || !target || target->type != BL_MOB) + if (sd == NULL || md == NULL) return 0; - md = (struct mob_data *)target; if (md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS) return 0; -- cgit v1.2.3-70-g09d2