summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-04-09 01:08:28 +0200
committerHaru <haru@dotalux.com>2017-04-09 01:08:28 +0200
commit55ec76c2ce71d44775516dcf168328fb614b69ff (patch)
tree508f4ebc69fc04dcc51ce98b663adc7364a9db30 /src
parent936e83b4dee144d509df2d02c3dddde2fe2f7cfc (diff)
downloadhercules-55ec76c2ce71d44775516dcf168328fb614b69ff.tar.gz
hercules-55ec76c2ce71d44775516dcf168328fb614b69ff.tar.bz2
hercules-55ec76c2ce71d44775516dcf168328fb614b69ff.tar.xz
hercules-55ec76c2ce71d44775516dcf168328fb614b69ff.zip
Fix a null pointer in guild->isallied()
Introduced in cb4297e6eb734c60825ebfa13f32989fa3a470eb, that doesn't check for a nonzero guild ID before calling guild->isallied(). Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 827042cce..8a0a71645 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6815,10 +6815,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
int s_party = status->get_party_id(s_bl);
int s_guild = status->get_guild_id(s_bl);
int t_guild = status->get_guild_id(t_bl);
-
- if (s_party && s_party == status->get_party_id(t_bl)) {
- if (map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !(s_guild && s_guild == t_guild)) {
- if (t_guild && guild->isallied(s_guild, t_guild))
+
+ if (s_party != 0 && s_party == status->get_party_id(t_bl)) {
+ if (map_flag_gvg(m) && map->list[m].flag.gvg_noparty) {
+ if (s_guild != 0 && t_guild != 0 && (s_guild == t_guild || guild->isallied(s_guild, t_guild)))
state |= BCT_PARTY;
else
state |= flag&BCT_ENEMY ? BCT_ENEMY : BCT_PARTY;