summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-26 13:10:59 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-26 13:10:59 +0200
commitd2e024bc100288ac0f52e082fb13679420e7d733 (patch)
tree174555573bb68ff3dc52012d776528498ea8d1d2 /rules.ts
parenta34edbc35373c994e83b92e4d2ac565b7a801785 (diff)
downloadplantagenet-d2e024bc100288ac0f52e082fb13679420e7d733.tar.gz
fix prompt_march when lord is not on map anymore
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/rules.ts b/rules.ts
index 4e0e03e..e1fa407 100644
--- a/rules.ts
+++ b/rules.ts
@@ -1167,6 +1167,10 @@ function is_lord_on_map(lord: Lord) {
return loc !== NOWHERE && loc < CALENDAR
}
+function is_locale_on_map(loc: Locale) {
+ return loc !== NOWHERE && loc < CALENDAR
+}
+
function is_lord_in_play(lord: Lord) {
return get_lord_locale(lord) !== NOWHERE
}
@@ -4733,6 +4737,9 @@ function can_action_march_to(to: Locale, type: "highway" | "road" | "path") {
function prompt_march() {
let from = get_lord_locale(game.command)
+ if (!is_locale_on_map(from))
+ return
+
for (let to of data.locales[from].highways)
if (can_action_march_to(to, "highway"))
gen_action_locale(to)