summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-19 07:00:19 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-19 07:00:19 +0000
commitafffcf816786d01ce876d2853dcab9648ec80247 (patch)
treecea46bdb8a16c0563d3e5abc9094b4c2a5f1b362 /src/map/battle.c
parent1faecaf7ca02d59bf32a41f995de89011d8e99fa (diff)
downloadhercules-afffcf816786d01ce876d2853dcab9648ec80247.tar.gz
hercules-afffcf816786d01ce876d2853dcab9648ec80247.tar.bz2
hercules-afffcf816786d01ce876d2853dcab9648ec80247.tar.xz
hercules-afffcf816786d01ce876d2853dcab9648ec80247.zip
Fixed bugreport:5618 @summon stuff trap-like skills no longer hit its allies
removed wrong target-type check on battle.c (its set in skill.c and then passed as its righteous flag to battle_check_target). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16129 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index a27ea59a1..c6b9dcba9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4696,32 +4696,27 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
default: break; //other type doesn't have slave yet
}
- switch( src->type )
- { //Checks on actual src type
+ switch( src->type ) { //Checks on actual src type
case BL_PET:
if (t_bl->type != BL_MOB && flag&BCT_ENEMY)
return 0; //Pet may not attack non-mobs.
if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->guardian_data && flag&BCT_ENEMY)
return 0; //pet may not attack Guardians/Emperium
break;
- case BL_SKILL:
- {
- struct skill_unit *su = (struct skill_unit *)src;
- int inf2 = 0;
- if (!su->group)
- return 0;
- if( battle_config.vs_traps_bctall && (target->type&battle_config.vs_traps_bctall) &&
- (inf2 = skill_get_inf2(su->group->skill_id))&INF2_TRAP &&
- map_flag_vs(src->m) )
- return 1;//traps may target everyone
- if (su->group->src_id == target->id) {
- if (inf2&INF2_NO_TARGET_SELF)
- return -1;
- if (inf2&INF2_TARGET_SELF)
- return 1;
+ case BL_SKILL: {
+ struct skill_unit *su = (struct skill_unit *)src;
+ if (!su->group)
+ return 0;
+
+ if (su->group->src_id == target->id) {
+ int inf2 = skill_get_inf2(su->group->skill_id);
+ if (inf2&INF2_NO_TARGET_SELF)
+ return -1;
+ if (inf2&INF2_TARGET_SELF)
+ return 1;
+ }
}
break;
- }
}
switch( s_bl->type )