diff options
author | Haru <haru@dotalux.com> | 2015-12-28 00:16:39 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-01-06 15:14:50 +0100 |
commit | f878d5e2156dc88fb73d27473acfe01d72427bbd (patch) | |
tree | 7bcb5cd894ffd776545f4fe480276476c7688252 /src/map/party.c | |
parent | b3c722ecf777aeeea6317755a6adfc0216b7a2bd (diff) | |
download | hercules-f878d5e2156dc88fb73d27473acfe01d72427bbd.tar.gz hercules-f878d5e2156dc88fb73d27473acfe01d72427bbd.tar.bz2 hercules-f878d5e2156dc88fb73d27473acfe01d72427bbd.tar.xz hercules-f878d5e2156dc88fb73d27473acfe01d72427bbd.zip |
Replaced some explicit casts with BL_UCAST/BL_UCCAST
- Replaced casts in foreach callbacks.
- Added assertions and nullpo checks where applicable.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/party.c b/src/map/party.c index 7d44a61c5..320370c33 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -1049,7 +1049,11 @@ int party_send_dot_remove(struct map_session_data *sd) // party_foreachsamemap(party->sub_count, sd, 0, &c); int party_sub_count(struct block_list *bl, va_list ap) { - struct map_session_data *sd = (struct map_session_data *)bl; + const struct map_session_data *sd = NULL; + + nullpo_ret(bl); + Assert_ret(bl->type == BL_PC); + sd = BL_UCCAST(BL_PC, bl); if (sd->state.autotrade) return 0; @@ -1112,7 +1116,11 @@ int party_vforeachsamemap(int (*func)(struct block_list*,va_list), struct map_se // Special check for Minstrel's and Wanderer's chorus skills. int party_sub_count_chorus(struct block_list *bl, va_list ap) { - struct map_session_data *sd = (struct map_session_data *)bl; + const struct map_session_data *sd = NULL; + + nullpo_ret(bl); + Assert_ret(bl->type == BL_PC); + sd = BL_UCCAST(BL_PC, bl); if (sd->state.autotrade) return 0; |