summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2024-02-18 03:20:44 +0100
committerteisuru <31881306+teisuru@users.noreply.github.com>2024-02-18 03:20:44 +0100
commit207cf362a12beee6294f8d8aa0b0b15386106dbd (patch)
treedb3e1e6c058146ca11731e4647779856fbd1c1d9 /rules.js
parentd913d2c8e1d8d3fb37e725a1dff250636762f024 (diff)
downloadplantagenet-207cf362a12beee6294f8d8aa0b0b15386106dbd.tar.gz
fix warden of the march routed units
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 667aa06..fb87677 100644
--- a/rules.js
+++ b/rules.js
@@ -8253,6 +8253,21 @@ states.warden_of_the_marches = {
for (let lord = first_lancaster_lord; lord <= last_lancaster_lord; lord++) {
if (get_lord_locale(lord) === game.battle.where) {
set_lord_locale(lord, loc)
+ if (!lord_has_unrouted_troops(lord)) {
+ disband_lord(lord, false)
+ }
+ else {
+ set_lord_forces(lord, RETINUE, 1)
+ }
+ if (get_lord_routed_forces(lord, x) > 0) {
+ set_lord_routed_forces(lord, x, 0)
+ }
+ for_each_vassal_with_lord(lord, v => {
+ if (set_has(game.battle.routed_vassals, v)) {
+ array_remove(game.battle.routed_vassals, v)
+ disband_vassal(v)
+ }
+ })
}
}
logi(`Moved to ${data.locales[loc].name}`)