summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-25 19:08:30 +0100
committerTor Andersson <tor@ccxvii.net>2022-12-26 01:03:31 +0100
commitb90061cc9ca2ce29e33a2e6e8347e7ae727f97bd (patch)
treed4381d166b44491783673271699e3b000e147509 /play.js
parent024f4746cd777655a0ed6816bdf6b97601e94c26 (diff)
downloadrommel-in-the-desert-b90061cc9ca2ce29e33a2e6e8347e7ae727f97bd.tar.gz
Follow 2004 edition map layout more strictly.
Don't show hexsides for out-of-play hexes. Add west exit area for allied player. Remove new edition marsh.
Diffstat (limited to 'play.js')
-rw-r--r--play.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/play.js b/play.js
index 9dad9ff..56802ce 100644
--- a/play.js
+++ b/play.js
@@ -8,11 +8,11 @@ const sqrt = Math.sqrt
// refit and queue hexes
const MALTA = 4
-const hex_special = [ 47, 48, 49, 102, 127, MALTA ]
+const hex_special = [ 47, 48, 49, 53, 102, 127, MALTA ]
const unit_count = 94
-const EXIT_HEXES = [ 99, 148, 197 ] // [ 99, 123, 148 ] //, 172, 197 ]
+const EXIT_HEXES = [ 99, 148, 175 ]
const REFIT_HEXES = [ 48, 102 ]
const BENGHAZI = 54
@@ -607,7 +607,8 @@ function build_hexes() {
for (let s = 0; s < 3; ++s) {
let next_id = hex_id + hexnext[s]
let side_id = hex_id * 3 + s
- add_line(ui.hex_x[hex_id], ui.hex_y[hex_id], s, side_id)
+ if (hex_exists[hex_id] || hex_exists[next_id])
+ add_line(ui.hex_x[hex_id], ui.hex_y[hex_id], s, side_id)
if (hex_exists[hex_id] && hex_exists[next_id])
add_path(ui.hex_x[hex_id], ui.hex_y[hex_id], ui.hex_x[next_id], ui.hex_y[next_id], side_id)
}
@@ -891,8 +892,10 @@ function update_map() {
ui.hexes[hex].classList.toggle("axis_control", is_hex_axis_controlled(hex))
ui.hexes[hex].classList.toggle("allied_control", is_hex_allied_controlled(hex))
for (let s = 0; s < 3; ++s) {
- ui.sides[hex*3+s].classList.toggle("axis_control", is_side_axis_controlled(hex*3+s))
- ui.sides[hex*3+s].classList.toggle("allied_control", is_side_allied_controlled(hex*3+s))
+ if (ui.sides[hex*3+s]) {
+ ui.sides[hex*3+s].classList.toggle("axis_control", is_side_axis_controlled(hex*3+s))
+ ui.sides[hex*3+s].classList.toggle("allied_control", is_side_allied_controlled(hex*3+s))
+ }
}
}
}