summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-29 19:26:09 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-29 19:26:09 +0000
commit0eecf99578c091875c8b34c233218e76f0898b94 (patch)
treee9528f3a873195ab3cacbb65c8b4669ac5aa6f7c /play.js
parent0e8b7cf6d84c6be64f3ee8ec082e900a201cbe28 (diff)
download1989-dawn-of-freedom-0eecf99578c091875c8b34c233218e76f0898b94.tar.gz
Fix spaces starting at 0 not 1
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/play.js b/play.js
index 2528f4e..10eeb96 100644
--- a/play.js
+++ b/play.js
@@ -401,7 +401,7 @@ function create_ui() {
ui.dem_inf = []
ui.com_inf = []
- for (let s = 1; s <= last_space; ++s) {
+ for (let s = 0; s <= last_space; ++s) {
let info = spaces[s]
let [ x, y, w, h ] = LAYOUT[info.ascii_name]
let xc = Math.round(x + w / 2)
@@ -451,10 +451,9 @@ function create_ui() {
for (let c = 1; c <= last_power_card; ++c) {
const power_card_e = document.createElement("div")
register_action(power_card_e, "power_card", c)
- power_card_e.className = "card power_" + c
+ power_card_e.className = "card power_card power_" + c
ui.power_cards[c] = power_card_e
}
-
ui.events = []
for (let id of box_events) {
ui.events[id] = document.createElement("div")
@@ -613,7 +612,7 @@ function on_update() {
// UPDATE INFLUENCE VALUES
- for (let s = 1; s <= last_space; ++s) {
+ for (let s = 0; s <= last_space; ++s) {
const demInfl = view.demInfl[s]
const comInfl = view.comInfl[s]
@@ -662,9 +661,6 @@ function on_update() {
if (view.show_opp_hand && view.opp_hand)
for (let c of view.opp_hand)
ui.opp_hand.appendChild(ui.cards[c])
-
- // TODO: fix rules to set view.opp_power_hand
- ui.opp_power_hand.replaceChildren()
if (view.opp_power_hand)
for (let c of view.opp_power_hand)
ui.opp_hand.appendChild(ui.power_cards[c])