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/clif.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/clif.c')
-rw-r--r-- | src/map/clif.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index dbfd71fea..827f57c45 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -192,7 +192,10 @@ static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, s //To identify disguised characters. static inline bool disguised(struct block_list* bl) { - return (bool)(bl->type == BL_PC && ((struct map_session_data *)bl)->disguise != -1); + struct map_session_data *sd = BL_CAST(BL_PC, bl); + if (sd == NULL || sd->disguise == -1) + return false; + return true; } //Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex] @@ -4532,8 +4535,10 @@ void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, en clif->send(&p,sizeof(p),bl,target); - if(su->group->skill_id == WZ_ICEWALL) - clif->changemapcell(bl->type == BL_PC ? ((struct map_session_data *)bl)->fd : 0, su->bl.m, su->bl.x, su->bl.y, 5, SELF); + if (su->group->skill_id == WZ_ICEWALL) { + struct map_session_data *sd = BL_CAST(BL_PC, bl); + clif->changemapcell(sd != NULL ? sd->fd : 0, su->bl.m, su->bl.x, su->bl.y, 5, SELF); + } } /*========================================== @@ -18654,7 +18659,7 @@ int clif_parse(int fd) { unsigned short (*parse_cmd_func)(int fd, struct map_session_data *sd); // begin main client packet processing loop - sd = (struct map_session_data *)sockt->session[fd]->session_data; + sd = sockt->session[fd]->session_data; if (sockt->session[fd]->flag.eof) { if (sd) { |