From 33c73232d062f0d5a1a58979a0518947769ecb3b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 29 Nov 2024 16:44:55 +0100 Subject: Carlisle and Bamburgh are adjacent to Scotland (one-way). Fixes bug with Supply not being traceable per 4.5.1 exception. --- data.js | 2 +- rules.js | 2 +- rules.ts | 2 +- tools/gendata.js | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/data.js b/data.js index 8637dae..874d50b 100644 --- a/data.js +++ b/data.js @@ -78,7 +78,7 @@ locales:[ {"name":"Burgundy","type":"exile_box","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":993,"y":684,"w":113,"h":132}}, {"name":"France","type":"exile_box","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":888,"y":1428,"w":113,"h":132}}, {"name":"Ireland","type":"exile_box","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":48,"y":950,"w":113,"h":132}}, -{"name":"Scotland","type":"exile_box","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[41,42],"not_paths":[],"box":{"x":449,"y":277,"w":113,"h":132}}, +{"name":"Scotland","type":"exile_box","region":null,"adjacent":[41,42],"highways":[],"roads":[],"paths":[41,42],"not_paths":[],"box":{"x":449,"y":277,"w":113,"h":132}}, {"name":"English Channel","type":"sea","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":550,"y":1450,"w":246,"h":82}}, {"name":"Irish Sea","type":"sea","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":224,"y":664,"w":135,"h":56}}, {"name":"North Sea","type":"sea","region":null,"adjacent":[],"highways":[],"roads":[],"paths":[],"not_paths":[],"box":{"x":1019,"y":824,"w":150,"h":65}}, diff --git a/rules.js b/rules.js index 64c2a23..73a5cc3 100644 --- a/rules.js +++ b/rules.js @@ -3339,7 +3339,7 @@ function search_supply_by_way(result, start, carts, ships) { let dist = search_dist[here]; let next_dist = dist + 8; if (can_supply_at(here, ships)) { - if (result) + if (Array.isArray(result)) map_set(result, here, dist); else return true; diff --git a/rules.ts b/rules.ts index 7c963f1..b8c839c 100644 --- a/rules.ts +++ b/rules.ts @@ -4070,7 +4070,7 @@ function search_supply_by_way(result, start: Locale, carts: number, ships: numbe let next_dist = dist + 8 if (can_supply_at(here, ships)) { - if (result) + if (Array.isArray(result)) map_set(result, here, dist) else return true diff --git a/tools/gendata.js b/tools/gendata.js index 2f4d90d..9e7cdf2 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -347,10 +347,12 @@ road("Ravenspur", "Lincoln") // one-way road from Scotland to Bamburgh locales[locmap.Scotland].paths.push(locmap.Bamburgh) +locales[locmap.Scotland].adjacent.push(locmap.Bamburgh) map_set(ways[locmap.Scotland], locmap.Bamburgh, "path") // one-way road from Scotland to Carlisle locales[locmap.Scotland].paths.push(locmap.Carlisle) +locales[locmap.Scotland].adjacent.push(locmap.Carlisle) map_set(ways[locmap.Scotland], locmap.Carlisle, "path") let sea_1 = locmap["North Sea"] -- cgit v1.2.3