diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-26 13:10:59 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-26 13:10:59 +0200 |
commit | d2e024bc100288ac0f52e082fb13679420e7d733 (patch) | |
tree | 174555573bb68ff3dc52012d776528498ea8d1d2 /rules.ts | |
parent | a34edbc35373c994e83b92e4d2ac565b7a801785 (diff) | |
download | plantagenet-d2e024bc100288ac0f52e082fb13679420e7d733.tar.gz |
fix prompt_march when lord is not on map anymore
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |