**AIRBASE**
- Runways are now retrieved from DCS API function
This commit is contained in:
Frank
2022-06-08 23:42:17 +02:00
parent a53595a055
commit 8926e06e44
7 changed files with 393 additions and 47 deletions

View File

@@ -1939,6 +1939,7 @@ function WAREHOUSE:New(warehouse, alias)
self:SetMarker(true)
self:SetReportOff()
self:SetRunwayRepairtime()
self.allowSpawnOnClientSpots=false
-- Add warehouse to database.
_WAREHOUSEDB.Warehouses[self.uid]=self
@@ -2584,6 +2585,14 @@ function WAREHOUSE:SetSafeParkingOff()
return self
end
--- Set wether client parking spots can be used for spawning.
-- @param #WAREHOUSE self
-- @return #WAREHOUSE self
function WAREHOUSE:SetAllowSpawnOnClientParking()
self.allowSpawnOnClientSpots=true
return self
end
--- Set low fuel threshold. If one unit of an asset has less fuel than this number, the event AssetLowFuel will be fired.
-- @param #WAREHOUSE self
-- @param #number threshold Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%).
@@ -7878,14 +7887,16 @@ function WAREHOUSE:_FindParkingForAssets(airbase, assets)
-- Get client coordinates.
local function _clients()
local clients=_DATABASE.CLIENTS
local coords={}
for clientname, client in pairs(clients) do
local template=_DATABASE:GetGroupTemplateFromUnitName(clientname)
local units=template.units
for i,unit in pairs(units) do
local coord=COORDINATE:New(unit.x, unit.alt, unit.y)
coords[unit.name]=coord
if not self.allowSpawnOnClientSpots then
local clients=_DATABASE.CLIENTS
for clientname, client in pairs(clients) do
local template=_DATABASE:GetGroupTemplateFromUnitName(clientname)
local units=template.units
for i,unit in pairs(units) do
local coord=COORDINATE:New(unit.x, unit.alt, unit.y)
coords[unit.name]=coord
end
end
end
return coords