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.
This commit is contained in:
Pax1601 2025-10-13 22:50:36 +02:00
parent 73af60d91b
commit c77173f7c9
2 changed files with 16 additions and 10 deletions

View File

@ -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,

View File

@ -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: "",