mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
db71610d72
@ -7405,6 +7405,8 @@ function WAREHOUSE:_CheckRequestNow(request)
|
|||||||
-- Check if at least one (cargo) asset is available.
|
-- Check if at least one (cargo) asset is available.
|
||||||
if _nassets>0 then
|
if _nassets>0 then
|
||||||
|
|
||||||
|
local asset=_assets[1] --#WAREHOUSE.Assetitem
|
||||||
|
|
||||||
-- Get the attibute of the requested asset.
|
-- Get the attibute of the requested asset.
|
||||||
_assetattribute=_assets[1].attribute
|
_assetattribute=_assets[1].attribute
|
||||||
_assetcategory=_assets[1].category
|
_assetcategory=_assets[1].category
|
||||||
@ -7415,6 +7417,19 @@ function WAREHOUSE:_CheckRequestNow(request)
|
|||||||
|
|
||||||
if self.airbase and self.airbase:GetCoalition()==self:GetCoalition() then
|
if self.airbase and self.airbase:GetCoalition()==self:GetCoalition() then
|
||||||
|
|
||||||
|
-- Check if DCS warehouse of airbase has enough assets
|
||||||
|
if self.airbase.storage then
|
||||||
|
local nS=self.airbase.storage:GetAmount(asset.unittype)
|
||||||
|
local nA=asset.nunits*request.nasset -- Number of units requested
|
||||||
|
if nS<nA then
|
||||||
|
local text=string.format("Warehouse %s: Request denied! DCS Warehouse has only %d assets of type %s ==> NOT enough to spawn the requested %d asset units (%d groups)",
|
||||||
|
self.alias, nS, asset.unittype, nA, request.nasset)
|
||||||
|
self:_InfoMessage(text, 5)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if self:IsRunwayOperational() or _assetairstart then
|
if self:IsRunwayOperational() or _assetairstart then
|
||||||
|
|
||||||
if _assetairstart then
|
if _assetairstart then
|
||||||
@ -7531,6 +7546,9 @@ function WAREHOUSE:_CheckRequestNow(request)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
elseif _assetcategory==Group.Category.AIRPLANE or _assetcategory==Group.Category.HELICOPTER then
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user