DATABASE & RAT

- DATABASE: spawned units (ships) are registered as airbases.
- RAT v2.3.8: script will not crash if (spawned) AIRBASE cannot be found .
This commit is contained in:
Frank
2019-11-04 22:17:26 +01:00
parent ddf61d1bf3
commit faa2debbae
2 changed files with 19 additions and 5 deletions

View File

@@ -923,6 +923,12 @@ function DATABASE:_EventOnBirth( Event )
if Event.IniObjectCategory == 1 then
self:AddUnit( Event.IniDCSUnitName )
self:AddGroup( Event.IniDCSGroupName )
-- Add airbase if it was spawned later in the mission.
local DCSAirbase = Airbase.getByName(Event.IniDCSUnitName)
if DCSAirbase then
self:I(string.format("Adding airbase %s", tostring(Event.IniDCSUnitName)))
self:AddAirbase(Event.IniDCSUnitName)
end
end
end
if Event.IniObjectCategory == 1 then