summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-28 00:16:39 +0100
committerHaru <haru@dotalux.com>2016-01-06 15:14:50 +0100
commitf878d5e2156dc88fb73d27473acfe01d72427bbd (patch)
tree7bcb5cd894ffd776545f4fe480276476c7688252 /src/map/status.c
parentb3c722ecf777aeeea6317755a6adfc0216b7a2bd (diff)
downloadhercules-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/status.c')
-rw-r--r--src/map/status.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c
index e29e27236..cfae64536 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -11783,9 +11783,12 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) {
if (battle->check_target( src, bl, BCT_ENEMY ) > 0
&& status->check_skilluse(src, bl, WZ_SIGHTBLASTER, 2)
) {
- struct skill_unit *su = (struct skill_unit *)bl;
- if (sce && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,sce->val1,tick,0x4000)
- && (!su || !su->group || !(skill->get_inf2(su->group->skill_id)&INF2_TRAP))) { // The hit is not counted if it's against a trap
+ const struct skill_unit *su = BL_CCAST(BL_SKILL, bl);
+ if (sce != NULL
+ && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,sce->val1,tick,0x4000)
+ && (su == NULL || su->group == NULL || !(skill->get_inf2(su->group->skill_id)&INF2_TRAP))
+ ) {
+ // The hit is not counted if it's against a trap
sce->val2 = 0; // This signals it to end.
} else if ((bl->type&BL_SKILL) && sce && sce->val4%2 == 0) {
//Remove trap immunity temporarily so it triggers if you still stand on it