summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-18 16:25:34 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-18 16:25:34 +0200
commita8a18fdf4be467d1c5d5257f2413c24e0b962d6b (patch)
treebc21fbde7e6da74de5e4de2ce06aa5a0272e2b37 /rules.ts
parentfc2932b6795b0a8db325196ea094ebd95f8e7655 (diff)
downloadplantagenet-a8a18fdf4be467d1c5d5257f2413c24e0b962d6b.tar.gz
Remove has_unbesieged_enemy_lord (same as has_enemy_lord).
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts16
1 files changed, 4 insertions, 12 deletions
diff --git a/rules.ts b/rules.ts
index 113551f..5a7b02a 100644
--- a/rules.ts
+++ b/rules.ts
@@ -1698,13 +1698,6 @@ function has_enemy_lord(loc: Locale) {
return false
}
-function has_unbesieged_enemy_lord(loc: Locale) {
- for (let lord of all_enemy_lords())
- if (get_lord_locale(lord) === loc)
- return true
- return false
-}
-
function is_lord_in_or_adjacent_to_north(lord: Lord) {
let here = get_lord_locale(lord)
if (is_north(here))
@@ -1751,7 +1744,7 @@ function other_marshal_or_lieutenant(loc: Locale) {
function has_adjacent_enemy(loc: Locale) {
for (let next of data.locales[loc].adjacent)
- if (has_unbesieged_enemy_lord(next))
+ if (has_enemy_lord(next))
return true
return false
}
@@ -4002,12 +3995,11 @@ function do_sail(to: Locale) {
else
spend_all_actions()
- // you can go to unbesieged enemy lord with norfolk capability
- if (has_unbesieged_enemy_lord(to))
+ // you can go to enemy lord with norfolk capability
+ if (has_enemy_lord(to))
goto_confirm_approach_sail()
- else {
+ else
resume_command()
- }
}
function goto_confirm_approach_sail() {