summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/play.js b/play.js
index 8248ede..25ca516 100644
--- a/play.js
+++ b/play.js
@@ -1209,10 +1209,6 @@ function on_update() {
hide(ui.barbarians[id])
else
show(ui.barbarians[id])
- if (is_barbarian_inactive(id))
- ui.barbarians[id].classList.toggle("inactive", true)
- else
- ui.barbarians[id].classList.toggle("inactive", false)
}
for (let id = BARBARIAN_COUNT[player_count-2]; id < 56; ++id)
hide(ui.barbarians[id])
@@ -1228,12 +1224,18 @@ function on_update() {
let loc = get_barbarian_location(id)
let inactive = is_barbarian_inactive(id)
if (loc === region) {
- if (is_battle_stack(region, "barbarians", tribe) && (region < 12 || !inactive))
+ let bb = is_battle_stack(region, "barbarians", tribe) && (region < 12 || !inactive)
+ if (bb)
battle.push(ui.barbarians[id])
else if (inactive)
inactive_barbarians.push(ui.barbarians[id])
else
active_barbarians.push(ui.barbarians[id])
+ // always show leaders as active during battle
+ if (!inactive || (bb && (id === CNIVA || id == ARDASHIR || id === SHAPUR)))
+ ui.barbarians[id].classList.toggle("inactive", false)
+ else
+ ui.barbarians[id].classList.toggle("inactive", true)
}
}
if (inactive_barbarians.length > 0)