summaryrefslogtreecommitdiff
path: root/src/map
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
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')
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/clif.c5
-rw-r--r--src/map/path.c2
-rw-r--r--src/map/script.c2
4 files changed, 3 insertions, 12 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();
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 040f86a58..3e6b4937b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3249,10 +3249,7 @@ void clif_changelook(struct block_list *bl,int type,int val)
#endif
break;
case LOOK_BODY2:
- if (val && (
- sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS ||
- sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK ||
- sd->sc.option&OPTION_OKTOBERFEST))
+ if (sd != NULL && (sd->sc.option&OPTION_COSTUME) != OPTION_NOTHING)
val = 0;
vd->body_style = val;
break;
diff --git a/src/map/path.c b/src/map/path.c
index f5e08d4df..07b38b740 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -192,10 +192,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i
/// Ensures there is enough space in array to store new element.
static void heap_push_node(struct node_heap *heap, struct path_node *node)
{
-#ifndef __clang_analyzer__ // TODO: Figure out why clang's static analyzer doesn't like this
BHEAP_ENSURE(*heap, 1, 256);
BHEAP_PUSH2(*heap, node, NODE_MINTOPCMP, swap_ptr);
-#endif // __clang_analyzer__
}
/// Updates path_node in the binary node_heap.
diff --git a/src/map/script.c b/src/map/script.c
index a1efbb3b8..d1aee29bf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5482,8 +5482,6 @@ bool script_sprintf(struct script_state *st, int start, struct StringBuf *out)
safestrncpy(buf, p, len);
StrBuf->AppendStr(out, buf);
}
-
- p = np;
np++;
// placeholder = "%%" ; (special case)