From 08adea8de7a35f3c989f73257662e65a53b27fac Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 29 Dec 2022 16:44:13 +0100 Subject: And lots of bug fixes. --- play.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 54a9853..10185a2 100644 --- a/play.js +++ b/play.js @@ -1394,9 +1394,9 @@ function update_battle() { ui.garrison.replaceChildren() if (view.battle.garrison) { for (let i = 0; i < view.battle.garrison.knights; ++i) - add_force(parent, KNIGHTS, -1, 0) + add_force(ui.garrison, KNIGHTS, -1, 0) for (let i = 0; i < view.battle.garrison.men_at_arms; ++i) - add_force(parent, MEN_AT_ARMS, -1, 0) + add_force(ui.garrison, MEN_AT_ARMS, -1, 0) } } @@ -1496,7 +1496,7 @@ function on_update() { ui.veche.classList.toggle("action", is_veche_action()) - if (view.battle) { + if (view.battle && view.battle.array) { ui.battle_panel.classList.remove("hide") ui.battle_header.textContent = "~ Battle at " + data.locales[view.battle.where].name + " ~" if (view.battle.attacker === player) { -- cgit v1.2.3