浏览代码

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

lemongrass3110 12 年之前
父节点
当前提交
9b076614e1
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 1 1
      conf/battle/skill.conf
  2. 7 5
      src/map/skill.c

+ 1 - 1
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):

+ 7 - 5
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;
 }