From 93767b217e251ad73c075a0d2ef040e12b24b101 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 8 Feb 2023 18:52:25 +0100 Subject: Fix color of siege marker when taking back conquered stronghold. --- play.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'play.js') 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)) } -- cgit v1.2.3