index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-02 17:19:26 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-05-02 17:19:26 -0700 |
commit | 734af1b5803a048e64e47b9eb49d41379e88cffc (patch) | |
tree | 2c341690f9be7a1bb239ace387cab57306555e45 /src/modules | |
parent | ddd32d47c5210eeda6209c6caa36a426a668cc21 (diff) |
Fix preexisting prone counter not removing if unit end movement without moving
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/game/soldier.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/game/soldier.js b/src/modules/game/soldier.js index c5b2323..ffb902b 100644 --- a/src/modules/game/soldier.js +++ b/src/modules/game/soldier.js @@ -115,11 +115,13 @@ export function removeClones(svg, counter) { } export function endMove(svg, counter) { - const proneCounter = counter.querySelector('[href="#counter-prone"]'); - - if (proneCounter) { - proneCounter.dataset.preexisting = ''; - } + Array.from(counter.children).forEach(n => { + if (n.classList.contains('removed')) { + n.remove(); + } else { + n.dataset.preexisting = ''; + } + }); svg.querySelector(traceSelector(counter))?.remove(); delete counter.dataset.previous; |