Browse Source

Resolves Cross Impact and bNoKnockback (#5717)

* Fixes #5707.
* Fixes Cross Impact and items with bNoKnockback causing a desync in the player's position on the client.
* Cross Impact will now fail when the player is unable to reach the target.
Thanks to @eppc0330 and @Balferian!
Aleos 4 years ago
parent
commit
0e9308cba6
1 changed files with 7 additions and 6 deletions
  1. 7 6
      src/map/skill.cpp

+ 7 - 6
src/map/skill.cpp

@@ -5671,12 +5671,13 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 			skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
 		}
 		break;
-	case GC_CROSSIMPACT: {
-			uint8 dir = map_calc_dir(bl, src->x, src->y);
-
-			if (skill_check_unit_movepos(5, src, bl->x, bl->y, 1, 1))
-				skill_blown(src, src, 1, (dir + 4) % 8, BLOWN_NONE); // Target position is actually one cell next to the target
-			skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
+	case GC_CROSSIMPACT:
+		if (skill_check_unit_movepos(5, src, bl->x, bl->y, 1, 1)) {
+			skill_blown(src, src, 1, (map_calc_dir(bl, src->x, src->y) + 4) % 8, BLOWN_IGNORE_NO_KNOCKBACK); // Target position is actually one cell next to the target
+			skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
+		} else {
+			if (sd)
+				clif_skill_fail(sd, skill_id, USESKILL_FAIL, 0);
 		}
 		break;