Quick check on airbase being a string

This commit is contained in:
Applevangelist 2023-09-17 16:52:45 +02:00
parent 7b027c0802
commit c173fe0cb8

View File

@ -2178,7 +2178,7 @@ end
-- @param #table Spots Table of parking spot IDs. Note that these in general are different from the numbering in the mission editor! -- @param #table Spots Table of parking spot IDs. Note that these in general are different from the numbering in the mission editor!
-- @param #SPAWN.Takeoff Takeoff (Optional) Takeoff type, i.e. either SPAWN.Takeoff.Cold or SPAWN.Takeoff.Hot. Default is Hot. -- @param #SPAWN.Takeoff Takeoff (Optional) Takeoff type, i.e. either SPAWN.Takeoff.Cold or SPAWN.Takeoff.Hot. Default is Hot.
-- @return Wrapper.Group#GROUP The group that was spawned or nil when nothing was spawned. -- @return Wrapper.Group#GROUP The group that was spawned or nil when nothing was spawned.
function SPAWN:SpawnAtParkingSpot( Airbase, Spots, Takeoff ) -- R2.5 function SPAWN:SpawnAtParkingSpot( Airbase, Spots, Takeoff )
self:F( { Airbase = Airbase, Spots = Spots, Takeoff = Takeoff } ) self:F( { Airbase = Airbase, Spots = Spots, Takeoff = Takeoff } )
-- Ensure that Spots parameter is a table. -- Ensure that Spots parameter is a table.
@ -2186,6 +2186,10 @@ function SPAWN:SpawnAtParkingSpot( Airbase, Spots, Takeoff ) -- R2.5
Spots = { Spots } Spots = { Spots }
end end
if type(Airbase) == "string" then
Airbase = AIRBASE:FindByName(Airbase)
end
-- Get template group. -- Get template group.
local group = GROUP:FindByName( self.SpawnTemplatePrefix ) local group = GROUP:FindByName( self.SpawnTemplatePrefix )