diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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)) + } } } } |