mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added fix for navy units too
This commit is contained in:
@@ -816,9 +816,13 @@ export class NavyUnitSpawnMenu extends UnitSpawnMenu {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var units = [];
|
var units = [];
|
||||||
|
let initialLat = unitTable.location.lat;
|
||||||
|
let initialLng = unitTable.location.lng;
|
||||||
|
let rows = Math.floor(Math.sqrt(unitsCount))
|
||||||
for (let i = 0; i < unitsCount; i++) {
|
for (let i = 0; i < unitsCount; i++) {
|
||||||
|
unitTable.location.lat = initialLat + i % rows * 0.0001;
|
||||||
|
unitTable.location.lng = initialLng + Math.floor(i / rows) * 0.0001;
|
||||||
units.push(JSON.parse(JSON.stringify(unitTable)));
|
units.push(JSON.parse(JSON.stringify(unitTable)));
|
||||||
unitTable.location.lat += i > 0? 0.0001: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getApp().getUnitsManager().spawnUnits("NavyUnit", units, getApp().getActiveCoalition(), false, spawnOptions.airbase ? spawnOptions.airbase.getName() : "", spawnOptions.country, (res: any) => {
|
getApp().getUnitsManager().spawnUnits("NavyUnit", units, getApp().getActiveCoalition(), false, spawnOptions.airbase ? spawnOptions.airbase.getName() : "", spawnOptions.country, (res: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user