From d2e024bc100288ac0f52e082fb13679420e7d733 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 26 Apr 2024 13:10:59 +0200 Subject: fix prompt_march when lord is not on map anymore --- rules.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rules.ts') 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) -- cgit v1.2.3