diff options
author | Haru <haru@dotalux.com> | 2015-12-28 15:41:36 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-01-06 15:18:39 +0100 |
commit | e3eac134b1607cfe78331e298aaa20b260662571 (patch) | |
tree | 135f15dadc1c7964b3078fd8223771f94d1ed0e6 /src/map/pc.c | |
parent | 0e05c1ed742707e0eb5923b562b2f6b8c6c5a3be (diff) | |
download | hercules-e3eac134b1607cfe78331e298aaa20b260662571.tar.gz hercules-e3eac134b1607cfe78331e298aaa20b260662571.tar.bz2 hercules-e3eac134b1607cfe78331e298aaa20b260662571.tar.xz hercules-e3eac134b1607cfe78331e298aaa20b260662571.zip |
Replaced the remaining explicit casts with BL_CAST/BL_UCAST
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 11 |
1 files changed, 4 insertions, 7 deletions
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; |