Issue information

Issue ID
#5560
Status
New
Severity
None
Started
Hercules Elf Bot
Apr 7, 2012 21:00
Last Post
Hercules Elf Bot
Apr 7, 2012 21:00
Confirmation
N/A

Hercules Elf Bot - Apr 7, 2012 21:00

Originally posted by [b]Lighta[/b]
So here the code in battle_check_target
[code]
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;
}
break;
}
[/code]
here if you look closely we assign inf2 to 0 then only rewrite it if battle_config.vs_traps_bctall && (target->type&battle_config.vs_traps_bctall) are both true.
If not then we exit this before assign inf2 then comparing it with targetself wich obliously gonna be false.
if (inf2&INF2_NO_TARGET_SELF) ==> 0&x ==> 0
So small typo here, I believe we must retrive the inf2 from skill 1st thing or condition or simply doing it outside.

Also isn't those battleconfig check redundant since we already set target all when posing the skill ?
[code]
case RA_ICEBOUNDTRAP:
if( map_flag_gvg(src->m) || map[src->m].flag.battleground )
limit *= 4; // longer trap times in WOE [celest]
if( battle_config.vs_traps_bctall && map_flag_vs(src->m) && (src->type&battle_config.vs_traps_bctall) )
target = BCT_ALL;
break;
[/code]

This post has been edited by Lighta on Apr 7, 2012 21:04