diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:34:08 +0100 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2024-02-14 14:34:08 +0100 |
commit | 63bdb2f68c49282845002523e4c58658ae50d680 (patch) | |
tree | 63dd3532a716cf74d0b8ec026316ea99e25a033a /rules.js | |
parent | 21768f8c7d77628e1cce7c5275e40ead39aaf685 (diff) | |
download | plantagenet-63bdb2f68c49282845002523e4c58658ae50d680.tar.gz |
assert all lords have troops or retinue outside of battle_losses and death_or_disband states
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -11879,10 +11879,19 @@ function assertMutuallyExclusiveLords() { } } +function assertAllLordsHaveTroopsOrRetinue() { + for (let lord = first_york_lord; lord <= last_lancaster_lord; ++lord) { + if (is_lord_on_map(lord) && !count_lord_all_forces(lord) && !get_lord_forces(lord, RETINUE)) + throw Error(`ASSERT: Lord "${data.lords[lord].name}" without troops or retinue`) + } +} + exports.assertState = function (state) { load_state(state) - assertMutuallyExclusiveLords() + // assertMutuallyExclusiveLords() + if (game.state !== "battle_losses" && game.state !== "death_or_disband") + assertAllLordsHaveTroopsOrRetinue() } let log_sanity = [] |