Set the new spawn altitude

This commit is contained in:
FlightControl_Master
2017-08-05 13:33:02 +02:00
parent 544b68c51f
commit 446ecc5b4d
2 changed files with 62 additions and 5 deletions

View File

@@ -989,9 +989,10 @@ end
-- @param #SPAWN self
-- @param Wrapper.Airbase#AIRBASE Airbase The @{Airbase} where to spawn the group.
-- @param #SPAWN.Takeoff Takeoff (optional) The location and takeoff method. Default is Hot.
-- @param #number TakeoffAltitude (optional) The altitude above the ground.
-- @return Wrapper.Group#GROUP that was spawned.
-- @return #nil Nothing was spawned.
function SPAWN:SpawnAtAirbase( Airbase, Takeoff ) -- R2.2
function SPAWN:SpawnAtAirbase( Airbase, Takeoff, TakeoffAltitude ) -- R2.2
self:F( { self.SpawnTemplatePrefix, Airbase } )
local PointVec3 = Airbase:GetPointVec3()
@@ -1025,7 +1026,7 @@ function SPAWN:SpawnAtAirbase( Airbase, Takeoff ) -- R2.2
SpawnTemplate.route.points[1].x = PointVec3.x
SpawnTemplate.route.points[1].y = PointVec3.z
SpawnTemplate.route.points[1].alt = PointVec3.y + 200
SpawnTemplate.route.points[1].alt = PointVec3.y + TakeoffAltitude
SpawnTemplate.route.points[1].type = GROUPTEMPLATE.Takeoff[Takeoff]
SpawnTemplate.route.points[1].airdromeId = Airbase:GetID()