summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-09 19:17:27 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-09 19:17:27 +0200
commit76dc6e30cdae5bcf011cd414447dc683e5bc3c47 (patch)
tree5cb48737a129ef2f9f0e24794f8c8ad81295c669 /rules.js
parent487c57a11660fd5e9c8d66b66eb5ff00eed0574f (diff)
downloadwashingtons-war-76dc6e30cdae5bcf011cd414447dc683e5bc3c47.tar.gz
don't allow sea move lone general to lone enemy general
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 62f6dca..4169bca 100644
--- a/rules.js
+++ b/rules.js
@@ -857,6 +857,8 @@ function place_american_reinforcements(who, count, where) {
}
logp("reinforced " + where + " with " + count + " CU");
place_american_cu(where, count);
+ if (has_enemy_general(where))
+ capture_enemy_general(where);
}
function place_french_reinforcements(who, where) {
@@ -2156,6 +2158,9 @@ function gen_move_general() {
if (to != from) {
if (is_non_blockaded_port(to)) {
if (!has_american_pc(to) && !has_american_or_french_cu(to)) {
+ // don't leave alone
+ if (alone && has_enemy_general(to))
+ continue
// TODO: duplicate action if can move by normal road
gen_action('move', to);
}