From c77173f7c959aeb8c47f4577b1fbc426202d27f2 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Mon, 13 Oct 2025 22:50:36 +0200 Subject: [PATCH] Enable AAA capability for infantry and fix map layer key case Set 'canAAA' to true for several infantry units in groundunitdatabase.json, allowing them to engage air targets. Updated map.ts to handle map layer keys in a case-insensitive manner, preventing issues with mismatched key casing. --- databases/units/groundunitdatabase.json | 16 ++++++++-------- frontend/react/src/map/map.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/databases/units/groundunitdatabase.json b/databases/units/groundunitdatabase.json index 2b5f3742..1dd7e28d 100644 --- a/databases/units/groundunitdatabase.json +++ b/databases/units/groundunitdatabase.json @@ -4011,7 +4011,7 @@ "shotsToFire": 5, "tags": "Russian Para", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 100, "aimMethodRange": 2000, "shotsBaseInterval": 5, @@ -4040,7 +4040,7 @@ "shotsToFire": 1, "tags": "Russian Para", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 50, "aimMethodRange": 750, "shotsBaseInterval": 5, @@ -5749,7 +5749,7 @@ "barrelHeight": 0.25, "tags": "US", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 100, "aimMethodRange": 2000, "shotsBaseInterval": 5, @@ -5828,7 +5828,7 @@ "shotsToFire": 5, "tags": "Georgia", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 100, "aimMethodRange": 2000, "shotsBaseInterval": 5, @@ -5899,7 +5899,7 @@ "shotsToFire": 5, "tags": "US", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 100, "aimMethodRange": 2000, "shotsBaseInterval": 5, @@ -5970,7 +5970,7 @@ "shotsToFire": 1, "tags": "Russian", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "targetingRange": 50, "aimMethodRange": 750, "shotsBaseInterval": 5, @@ -7849,7 +7849,7 @@ "shotsToFire": 5, "tags": "Insurgent", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "aimMethodRange": 2000, "targetingRange": 100, "shotsBaseInterval": 5, @@ -8101,7 +8101,7 @@ "shotsToFire": 5, "tags": "Russian type 3", "markerFile": "groundunit-infantry", - "canAAA": false, + "canAAA": true, "aimMethodRange": 2000, "targetingRange": 100, "shotsBaseInterval": 5, diff --git a/frontend/react/src/map/map.ts b/frontend/react/src/map/map.ts index af7ce75d..16f8ad63 100644 --- a/frontend/react/src/map/map.ts +++ b/frontend/react/src/map/map.ts @@ -560,10 +560,16 @@ export class Map extends L.Map { } }) .then((res: any) => { - if ("alt-" + theatre.toLowerCase() in res) { + // Convert the result keys to lower case to avoid case sensitivity issues + const lowerCaseRes: any = {}; + for (const key in res) { + lowerCaseRes[key.toLowerCase()] = res[key]; + } + + if ("alt-" + theatre.toLowerCase() in lowerCaseRes) { let template = `${mirror}/alt-${theatre.toLowerCase()}/{z}/{x}/{y}.png`; layers.push( - ...res["alt-" + theatre.toLowerCase()].map((layerConfig: any) => { + ...lowerCaseRes["alt-" + theatre.toLowerCase()].map((layerConfig: any) => { return new L.TileLayer(template, { ...layerConfig, crossOrigin: "",