diff --git a/data/SH_data/weapon_specials/knockback.cfg b/data/SH_data/weapon_specials/knockback.cfg index c81fa65fe..a4761bf0b 100644 --- a/data/SH_data/weapon_specials/knockback.cfg +++ b/data/SH_data/weapon_specials/knockback.cfg @@ -33,88 +33,7 @@ [/variable] [then] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=n - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction n} - [/then] - [else] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=ne - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction ne} - [/then] - [else] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=se - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction se} - [/then] - [else] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=s - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction s} - [/then] - [else] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=sw - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction sw} - [/then] - [else] - [if] - [have_unit] - x,y=$x1,$y1 - [filter_adjacent] - x,y=$x2,$y2 - adjacent=nw - [/filter_adjacent] - [/have_unit] - [then] - {VARIABLE knockback_direction nw} - [/then] - [/if] - [/else] - [/if] - [/else] - [/if] - [/else] - [/if] - [/else] - [/if] - [/else] - [/if] + {VARIABLE knockback_direction "$(relative_dir(loc($unit.x,$unit.y), loc($second_unit.x,$second_unit.y)))"} [store_locations] [not]