Added missing default values for skill of ground units in IADS generator

This commit is contained in:
Pax1601 2024-03-18 08:33:57 +01:00
parent 61fb80d67f
commit e0ad679b57
4 changed files with 4 additions and 17 deletions

View File

@ -75,7 +75,7 @@ export interface UnitSpawnTable {
location: LatLng,
altitude?: number,
loadout?: string,
skill?: string,
skill: string,
liveryID: string
}

View File

@ -214,19 +214,6 @@ export abstract class UnitDatabase {
return null;
}
generateTestGrid(initialPosition: LatLng) {
var filteredBlueprints = this.getBlueprints();
const step = 0.01;
var nUnits = Object.values(filteredBlueprints).length;
var gridSize = Math.ceil(Math.sqrt(nUnits));
Object.values(filteredBlueprints).forEach((unitBlueprint: UnitBlueprint, idx: number) => {
var row = Math.floor(idx / gridSize);
var col = idx - row * gridSize;
var location = new LatLng(initialPosition.lat + col * step, initialPosition.lng + row * step)
getApp().getUnitsManager().spawnUnits(this.getCategory(), [{unitType: unitBlueprint.name, location: location, altitude: 1000, loadout: "", liveryID: ""}]);
})
}
getSpawnPointsByLabel(label: string) {
var blueprint = this.getByLabel(label);
if (blueprint)

View File

@ -44,7 +44,7 @@ export class UnitDataFileImport extends UnitDataFile {
continue;
let unitsToSpawn = groupData.filter((unitData: UnitData) => this.#unitDataCanBeImported(unitData)).map((unitData: UnitData) => {
return { unitType: unitData.name, location: unitData.position, liveryID: "" }
return { unitType: unitData.name, location: unitData.position, liveryID: "", skill: "High" }
});
unitsManager.spawnUnits(category, unitsToSpawn, coalition, false);

View File

@ -1320,7 +1320,7 @@ export class UnitsManager {
unitBlueprint = randomUnitBlueprint(groundUnitDatabase, { type: type, eras: activeEras, ranges: activeRanges });
if (unitBlueprint)
this.spawnUnits("GroundUnit", [{ unitType: unitBlueprint.name, location: latlng, liveryID: "" }], coalitionArea.getCoalition(), false, "", "");
this.spawnUnits("GroundUnit", [{ unitType: unitBlueprint.name, location: latlng, liveryID: "", skill: "High" }], coalitionArea.getCoalition(), false, "", "");
}
}
}
@ -1350,7 +1350,7 @@ export class UnitsManager {
unitBlueprint = randomUnitBlueprint(groundUnitDatabase, { type: type, eras: activeEras, ranges: activeRanges });
if (unitBlueprint)
this.spawnUnits("GroundUnit", [{ unitType: unitBlueprint.name, location: latlng, liveryID: "" }], coalitionArea.getCoalition(), false, "", "");
this.spawnUnits("GroundUnit", [{ unitType: unitBlueprint.name, location: latlng, liveryID: "", skill: "High" }], coalitionArea.getCoalition(), false, "", "");
}
}
}