From 9b076614e11cd6f30b2637472d666cae1455f65c Mon Sep 17 00:00:00 2001 From: lemongrass3110 Date: Sat, 30 Mar 2013 12:53:54 +0000 Subject: [PATCH] Fixed place skills to target the caster when it should not. Related mainly to dance skills and quagmire. Thanks again to playtester for showing me how to reproduce it and test the fix afterwards. Related bugreports: bugreport:7221 bugreport:6686 git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17223 54d463be-8e91-2dee-dedb-b68131a5f0ec --- conf/battle/skill.conf | 2 +- src/map/skill.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index e955532319..ee28fec43b 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -112,7 +112,7 @@ skill_reiteration: 0 skill_nofootset: 1 // Should traps (hunter traps + quagmire) change their target to "all" inside gvg/pvp grounds? (Note 3) -// Default on official servers: yes for player-traps +// Default on official servers: 1 (for players) gvg_traps_target_all: 1 // Some traps settings (add as necessary): diff --git a/src/map/skill.c b/src/map/skill.c index 5bc8d8bc36..69eff8136e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -12350,6 +12350,7 @@ static int skill_unit_effect (struct block_list* bl, va_list ap) unsigned int flag = va_arg(ap,unsigned int); uint16 skill_id; bool dissonance; + bool isTarget = false; if( (!unit->alive && !(flag&4)) || bl->prev == NULL ) return 0; @@ -12361,10 +12362,8 @@ static int skill_unit_effect (struct block_list* bl, va_list ap) //Necessary in case the group is deleted after calling on_place/on_out [Skotlex] skill_id = group->skill_id; //Target-type check. - if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) && (flag&4) ) { - if( group->state.song_dance&0x1 || (group->src_id == bl->id && group->state.song_dance&0x2) ) - skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it. - } else { + isTarget = group->bl_flag & bl->type && battle_check_target( &unit->bl, bl, group->target_flag ) > 0; + if( isTarget ){ if( flag&1 ) skill_unit_onplace(unit,bl,tick); else @@ -12372,9 +12371,12 @@ static int skill_unit_effect (struct block_list* bl, va_list ap) if( flag&4 ) skill_unit_onleft(skill_id, bl, tick); + }else if( !isTarget && flag&4 && ( group->state.song_dance&0x1 || ( group->src_id == bl->id && group->state.song_dance&0x2 ) ) ){ + skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it. } - if( dissonance ) skill_dance_switch(unit, 1); + if( dissonance ) + skill_dance_switch(unit, 1); return 0; }