summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-09-15 15:29:16 +0200
committerHaru <haru@dotalux.com>2016-10-07 01:10:28 +0200
commitc5780deadbda31d4a76e7f4ded866d769c2a1151 (patch)
tree42a3c979fa9f96ddfe014f485115dffc4e9883d3 /src/map/battle.c
parent953feee90e47d75449151834707a165f9ce57fda (diff)
downloadhercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.gz
hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.bz2
hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.tar.xz
hercules-c5780deadbda31d4a76e7f4ded866d769c2a1151.zip
Fixed some issues detected by clang's static analyzer (Xcode 8/macOS Sierra)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index daef8f6a8..67ab8c9b8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6008,20 +6008,18 @@ int battle_damage_area(struct block_list *bl, va_list ap) {
if (bl->type == BL_MOB && BL_UCCAST(BL_MOB, bl)->class_ == MOBID_EMPELIUM)
return 0;
if( bl != src && battle->check_target(src,bl,BCT_ENEMY) > 0 ) {
- struct map_session_data *sd = NULL;
nullpo_ret(src);
map->freeblock_lock();
- sd = BL_CAST(BL_PC, src);
if (src->type == BL_PC)
- battle->drain(sd, bl, damage, damage, status_get_race(bl), is_boss(bl));
+ battle->drain(BL_UCAST(BL_PC, src), bl, damage, damage, status_get_race(bl), is_boss(bl));
if( amotion )
battle->delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0,true);
else
status_fix_damage(src,bl,damage,0);
clif->damage(bl,bl,amotion,dmotion,damage,1,BDT_ENDURE,0);
- if (src->type != BL_PC || !sd->state.autocast)
+ if (src->type != BL_PC || !BL_UCCAST(BL_PC, src)->state.autocast)
skill->additional_effect(src, bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
map->freeblock_unlock();
}