Update Warehouse.lua

- added airbase coalition check when spawning aircraft #1413
This commit is contained in:
Frank 2020-12-29 22:28:36 +01:00
parent 6e35b80daf
commit 1bb70b8697

View File

@ -7181,7 +7181,7 @@ function WAREHOUSE:_CheckRequestNow(request)
-- Check available parking for air asset units. -- Check available parking for air asset units.
if _assetcategory==Group.Category.AIRPLANE or _assetcategory==Group.Category.HELICOPTER then if _assetcategory==Group.Category.AIRPLANE or _assetcategory==Group.Category.HELICOPTER then
if self.airbase then if self.airbase and self.airbase:GetCoalition()==self:GetCoalition() then
if self:IsRunwayOperational() then if self:IsRunwayOperational() then
@ -7233,7 +7233,7 @@ function WAREHOUSE:_CheckRequestNow(request)
-- Check available parking for transport units. -- Check available parking for transport units.
if _transportcategory==Group.Category.AIRPLANE or _transportcategory==Group.Category.HELICOPTER then if _transportcategory==Group.Category.AIRPLANE or _transportcategory==Group.Category.HELICOPTER then
if self.airbase then if self.airbase and self.airbase:GetCoalition()==self:GetCoalition() then
if self:IsRunwayOperational() then if self:IsRunwayOperational() then
@ -7537,7 +7537,7 @@ function WAREHOUSE:_CheckQueue()
-- Check if request is possible now. -- Check if request is possible now.
local okay=false local okay=false
if valid then if valid then
okay=self:_CheckRequestNow(qitem) okay=self:_CheckRequestNow(qitem)
else else
-- Remember invalid request and delete later in order not to confuse the loop. -- Remember invalid request and delete later in order not to confuse the loop.