summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-29 16:44:13 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit08adea8de7a35f3c989f73257662e65a53b27fac (patch)
tree2afa4dfc2e82328437f8f3556cd861f140ed17c9 /play.js
parent1159095b92d85e934037f2c0323135b2e443b0e6 (diff)
downloadnevsky-08adea8de7a35f3c989f73257662e65a53b27fac.tar.gz
And lots of bug fixes.
Diffstat (limited to 'play.js')
-rw-r--r--play.js6
1 files changed, 3 insertions, 3 deletions
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) {