summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-11-02 16:20:54 +0100
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:18 +0100
commitece767a27dc7a5903d247fc3c6e8100074d4f579 (patch)
treeccb031c63cf1784cb2c44a3f80eb3fe3093fa535 /play.js
parent72750321e47f6c6f447efec09220dd4ae94d9f57 (diff)
downloadhammer-of-the-scots-ece767a27dc7a5903d247fc3c6e8100074d4f579.tar.gz
Mark blocks as moved after taking the first step.
This masks movement of King/Hobelars/Wallace/etc who can move 3 steps.
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 26b2407..608d2d9 100644
--- a/play.js
+++ b/play.js
@@ -488,7 +488,7 @@ function update_map() {
for (let area = 1; area < AREAS.length; ++area)
layout[area] = { north: [], south: [] }
- for (let b in view.location) {
+ for (let b = 0; b < BLOCKS.length; ++b) {
if (view.location[b] === 0 && BLOCKS[b].mortal) {
let element = ui.blocks[b]
if (BLOCKS[b].owner === "Scotland")
@@ -498,12 +498,12 @@ function update_map() {
}
}
- for (let b in view.location) {
+ for (let b = 0; b < BLOCKS.length; ++b) {
let info = BLOCKS[b]
let element = ui.blocks[b]
let area = view.location[b]
if (area > 0 || BLOCKS[b].mortal) {
- let moved = set_has(view.moved, b) ? " moved" : ""
+ let moved = (set_has(view.moved, b) && view.who !== b) ? " moved" : ""
if (is_known_block(b) || area === 0) {
let image = " block_" + info.image
let steps = " r" + (info.steps - view.steps[b])