summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-27 23:52:48 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commitc7f41534edfdd9c66c6f63441c7ecd7fdf46cf29 (patch)
treec2da2b8d1196b46ab730130418e5d7d3cf4f4773 /rules.js
parent189af147e9631e428a20d928a14f61cd6f90b290 (diff)
downloadnevsky-c7f41534edfdd9c66c6f63441c7ecd7fdf46cf29.tar.gz
Fix Black Sea Trade + Lodya.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 7e807de..4499e1f 100644
--- a/rules.js
+++ b/rules.js
@@ -5399,6 +5399,13 @@ function goto_sally() {
// NOTE: Lodya > 0 is ships as boats
// NOTE: Lodya < 0 is boats as ships
+function find_lodya_lord_on_map() {
+ for (let lord = first_friendly_lord; lord <= last_friendly_lord; ++lord)
+ if (is_lord_on_map(lord) && lord_has_capability(lord, AOW_RUSSIAN_LODYA))
+ return lord
+ return NOBODY
+}
+
function find_lodya_lord_in_shared() {
let here = get_lord_locale(game.command)
for (let lord = first_friendly_lord; lord <= last_friendly_lord; ++lord)
@@ -5443,7 +5450,7 @@ function init_lodya_march(type) {
}
function init_lodya_baltic_sea_trade() {
- let lord = find_lodya_lord_in_shared()
+ let lord = find_lodya_lord_on_map()
if (lord !== NOBODY) {
game.flags.lodya = -Math.min(2, get_lord_assets(lord, BOAT))
if (game.flags.lodya < 0)