diff options
-rw-r--r-- | rules.js | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1468,11 +1468,9 @@ function goto_final_supply_check() { for_each_friendly_unit(u => { let x = unit_hex(u) - if (!snet[x]) { - if (!is_unit_disrupted(u) && !is_unit_supplied(u)) { - log(`Disrupted at #${x}`) - set_unit_disrupted(u) - } + if (is_map_hex(x) && !snet[x] && !is_unit_disrupted(u) && !is_unit_supplied(u)) { + log(`Disrupted at #${x}`) + set_unit_disrupted(u) } }) @@ -2003,6 +2001,12 @@ function can_retreat_with_regroup_move(from, to, rommel) { } function can_select_retreat_hex() { + update_supply_networks() + let sline = is_axis_player() ? game.axis_supply_line : game.allied_supply_line + let sdist = is_axis_player() ? distance_to[EL_AGHEILA] : distance_to[ALEXANDRIA] + let rommel1 = (game.rommel === 1) ? 1 : 0 + let rommel2 = (game.rommel === 2) ? 1 : 0 + if (!game.to1 && game.from1) if (can_retreat_with_group_move(game.from1, sline, sdist)) return true @@ -2041,6 +2045,8 @@ states.retreat_from = { update_supply_networks() let sline = is_axis_player() ? game.axis_supply_line : game.allied_supply_line let sdist = is_axis_player() ? distance_to[EL_AGHEILA] : distance_to[ALEXANDRIA] + let rommel1 = (game.rommel === 1) ? 1 : 0 + let rommel2 = (game.rommel === 2) ? 1 : 0 if (!game.to1 && game.from1) { if (can_retreat_with_group_move(game.from1, sline, sdist)) |