DCS stable

- Added check that ` Airbase.getWarehouse`  method exists because it causes problems with DCS stable as this method does not exist there.
This commit is contained in:
Frank 2023-11-17 00:26:21 +01:00
parent 5353be482e
commit 0bc52eb331
2 changed files with 5 additions and 3 deletions

View File

@ -929,7 +929,7 @@ end
function AIRBASE:GetWarehouse() function AIRBASE:GetWarehouse()
local warehouse=nil --DCS#Warehouse local warehouse=nil --DCS#Warehouse
local airbase=self:GetDCSObject() local airbase=self:GetDCSObject()
if airbase then if airbase and Airbase.getWarehouse then
warehouse=airbase:getWarehouse() warehouse=airbase:getWarehouse()
end end
return warehouse return warehouse

View File

@ -168,8 +168,10 @@ function STORAGE:New(AirbaseName)
local self=BASE:Inherit(self, BASE:New()) -- #STORAGE local self=BASE:Inherit(self, BASE:New()) -- #STORAGE
self.airbase=Airbase.getByName(AirbaseName) self.airbase=Airbase.getByName(AirbaseName)
self.warehouse=self.airbase:getWarehouse() if Airbase.getWarehouse then
self.warehouse=self.airbase:getWarehouse()
end
self.lid = string.format("STORAGE %s", AirbaseName) self.lid = string.format("STORAGE %s", AirbaseName)