mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Fixed bug with parking spot generation
This commit is contained in:
parent
6ce6a8d2a1
commit
525484385a
@ -96,7 +96,6 @@ do
|
|||||||
for _,p in pairs(parkings) do
|
for _,p in pairs(parkings) do
|
||||||
local parkingUniqueID = pickedAirbase:getID() * 10000 + p.Term_Index
|
local parkingUniqueID = pickedAirbase:getID() * 10000 + p.Term_Index
|
||||||
if p.Term_Type == 104 and not DCSEx.table.contains(usedParkingSpots, parkingUniqueID) then
|
if p.Term_Type == 104 and not DCSEx.table.contains(usedParkingSpots, parkingUniqueID) then
|
||||||
table.insert(usedParkingSpots, parkingUniqueID) -- Make sure parking spot won't be used by another objective
|
|
||||||
table.insert(validParkings, p)
|
table.insert(validParkings, p)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -105,6 +104,7 @@ do
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local pickedParking = DCSEx.table.getRandom(validParkings)
|
local pickedParking = DCSEx.table.getRandom(validParkings)
|
||||||
|
table.insert(usedParkingSpots, pickedAirbase:getID() * 10000 + pickedParking.Term_Index) -- Mark parking spot as used so it won't be taken by another objective
|
||||||
parkingInfo = { airbaseID = pickedAirbase:getID(), parkingID = pickedParking.Term_Index }
|
parkingInfo = { airbaseID = pickedAirbase:getID(), parkingID = pickedParking.Term_Index }
|
||||||
spawnPoint3 = pickedParking.vTerminalPos
|
spawnPoint3 = pickedParking.vTerminalPos
|
||||||
spawnPoint2 = DCSEx.math.vec3ToVec2(spawnPoint3)
|
spawnPoint2 = DCSEx.math.vec3ToVec2(spawnPoint3)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user