diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-04 15:23:56 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:42:59 +0100 |
commit | 485e37962c9d30d08a8c7b132f3b0eab64df4015 (patch) | |
tree | 40e4a9d211c51a267b8d69b44e17cba28b8bb550 /rules.js | |
parent | 2ca1651520f413b7ce9ebc6fcae5a609169c0ab7 (diff) | |
download | 300-earth-and-water-485e37962c9d30d08a8c7b132f3b0eab64df4015.tar.gz |
300: fix land retreat
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1704,7 +1704,7 @@ function resume_greek_land_battle(_, current) { end_battle(); } -function gen_land_retreat_attacker(view) { +function gen_land_retreat_attacker(view, is_friendly_control) { // RULES: if land movement started in neighboring city, do they have to // retreat to origin city if it is neighboring, or could they have gone // a circuitous route to attack from another direction? @@ -1712,7 +1712,7 @@ function gen_land_retreat_attacker(view) { gen_action(view, 'city', game.from); else for (let city of ROADS[game.where]) - if (city in game.move_list) + if (is_friendly_control(city) && city in game.move_list) gen_action(view, 'city', city); } @@ -1724,7 +1724,7 @@ states.persian_land_retreat_attacker = { if (game.naval_battle) gen_action(view, 'port', game.from); else - gen_land_retreat_attacker(view); + gen_land_retreat_attacker(view, is_persian_control); gen_action(view, 'city', game.where); // shortcut for battle gen_action(view, 'battle'); }, @@ -1758,7 +1758,7 @@ states.greek_land_retreat_attacker = { if (game.naval_battle) gen_action(view, 'port', game.from); else - gen_land_retreat_attacker(view); + gen_land_retreat_attacker(view, is_greek_control); gen_action(view, 'city', game.where); // shortcut for battle gen_action(view, 'battle'); }, |