summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-08 18:52:25 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:40 +0100
commit93767b217e251ad73c075a0d2ef040e12b24b101 (patch)
tree4ca19d503b0a1e92f99d07d10edc4961fa16f4f0 /play.js
parent990976293307ad261b7818b096d12f1b4746d8e7 (diff)
downloadnevsky-93767b217e251ad73c075a0d2ef040e12b24b101.tar.gz
Fix color of siege marker when taking back conquered stronghold.
Diffstat (limited to 'play.js')
-rw-r--r--play.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/play.js b/play.js
index 2983490..b75109b 100644
--- a/play.js
+++ b/play.js
@@ -1261,6 +1261,17 @@ function update_castle(elt, loc) {
}
}
+function is_teutonic_siege_marker(loc) {
+ if (set_has(view.pieces.castles2, loc))
+ return true
+ if (set_has(view.pieces.castles1, loc))
+ return false
+ if (is_p1_locale(loc))
+ return set_has(view.pieces.conquered, loc)
+ else
+ return !set_has(view.pieces.conquered, loc)
+}
+
function update_locale(loc) {
layout_locale_cylinders(loc)
@@ -1305,10 +1316,10 @@ function update_locale(loc) {
let sieges = map_get(view.pieces.sieges, loc)
if (sieges > 0) {
let cn
- if (is_p1_locale(loc) || set_has(view.pieces.castles1, loc))
- cn = "marker square siege russian"
- else
+ if (is_teutonic_siege_marker(loc))
cn = "marker square siege teutonic"
+ else
+ cn = "marker square siege russian"
for (let i = 0; i < sieges; ++i)
ui.locale_markers[loc].appendChild(get_cached_element(cn))
}