mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
fix: Ground units spawned in group are on top of each other, no heading when importing units
Units spawned via map, context menu, or unit spawn menu now include a heading property and are offset in latitude to prevent overlap. Also ensures heading is set during import/export. Minor JSX formatting improvements in UnitSpawnMenu.
This commit is contained in:
@@ -660,7 +660,13 @@ export function SpawnContextMenu(props: {}) {
|
||||
.getUnitsManager()
|
||||
.spawnUnits(
|
||||
spawnRequestTable.category,
|
||||
Array(spawnRequestTable.amount).fill(spawnRequestTable.unit),
|
||||
Array(spawnRequestTable.amount).fill(spawnRequestTable.unit).map((unit, index) => {
|
||||
return {
|
||||
...unit,
|
||||
location: new LatLng(unit.location.lat + (spawnRequestTable?.category === "groundunit" ? 0.00025 * index : 0.005 * index), unit.location.lng),
|
||||
heading: unit.heading || 0,
|
||||
};
|
||||
}),
|
||||
spawnRequestTable.coalition,
|
||||
false
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user