This commit is contained in:
Frank
2019-09-13 10:24:55 +02:00
parent a3067740a3
commit 367c67f269
3 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -554,7 +554,7 @@ end
-- @param #table SpawnTemplate Template of the group to spawn.
-- @param #string Groupname (Optional) Name of the group.
-- @return Wrapper.Group#GROUP Spawned group.
function DATABASE:Spawn( SpawnTemplate, Groupname )
function DATABASE:Spawn( SpawnTemplate )
self:F( SpawnTemplate.name )
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
@@ -569,7 +569,7 @@ function DATABASE:Spawn( SpawnTemplate, Groupname )
SpawnTemplate.CountryID = nil
SpawnTemplate.CategoryID = nil
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID, Groupname )
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID )
self:T3( SpawnTemplate )
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
+3 -5
View File
@@ -1301,8 +1301,7 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold)
local wp={}
wp[1]=self.group:GetCoordinate():WaypointAir(nil, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.FlyoverPoint,SpeedTo, true , nil, {}, "Current Pos")
wp[2]=coordAB:WaypointAir(nil, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.FlyoverPoint,SpeedTo, true , nil, {TaskArrived, TaskControlled}, "Holding Point")
wp[3]=coordAB:Translate(50000, 270):WaypointAir(nil, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.FlyoverPoint,SpeedTo, true , nil, {}, "Test 50 km")
wp[4]=coordAB:WaypointAirLanding(SpeedHold, airbase, {}, "Landing")
wp[3]=coordAB:WaypointAirLanding(SpeedHold, airbase, {}, "Landing")
local respawn=true
@@ -1316,13 +1315,12 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold)
MESSAGE:New("Respawning group"):ToAll()
--Respawn the group.
self.group=self.group:Respawn(Template, nil)
self.group=self.group:Respawn(Template, true)
end
self.group:Route(wp, 0.1)
--self.group:Route(wp, 1)
--self:RouteRTB(RTBAirbase,Speed,Altitude,TaskOverhead)
end
+3 -3
View File
@@ -1639,7 +1639,7 @@ function GROUP:Respawn( Template, Reset )
self:F(GroupUnit:GetName())
if GroupUnit:IsAlive() then
self:F("Alive")
self:I("FF Alive")
-- Get unit position vector.
local GroupUnitVec3 = GroupUnit:GetVec3()
@@ -1739,8 +1739,8 @@ function GROUP:Respawn( Template, Reset )
local coord=unit:GetCoordinate()
local heading=unit:GetHeading()
Unit.x=coord.x
Unit.z=coord.y
Unit.alt=coord.alt
Unit.y=coord.z
Unit.alt=coord.y
Unit.heading=math.rad(heading)
Unit.psi=-Unit.heading
end