From 207cf362a12beee6294f8d8aa0b0b15386106dbd Mon Sep 17 00:00:00 2001 From: teisuru <31881306+teisuru@users.noreply.github.com> Date: Sun, 18 Feb 2024 03:20:44 +0100 Subject: fix warden of the march routed units --- rules.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'rules.js') 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}`) -- cgit v1.2.3