mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-21 11:53:30 +00:00
ops
This commit is contained in:
@@ -554,7 +554,7 @@ end
|
|||||||
-- @param #table SpawnTemplate Template of the group to spawn.
|
-- @param #table SpawnTemplate Template of the group to spawn.
|
||||||
-- @param #string Groupname (Optional) Name of the group.
|
-- @param #string Groupname (Optional) Name of the group.
|
||||||
-- @return Wrapper.Group#GROUP Spawned group.
|
-- @return Wrapper.Group#GROUP Spawned group.
|
||||||
function DATABASE:Spawn( SpawnTemplate, Groupname )
|
function DATABASE:Spawn( SpawnTemplate )
|
||||||
self:F( SpawnTemplate.name )
|
self:F( SpawnTemplate.name )
|
||||||
|
|
||||||
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
|
self:T( { SpawnTemplate.SpawnCountryID, SpawnTemplate.SpawnCategoryID } )
|
||||||
@@ -569,7 +569,7 @@ function DATABASE:Spawn( SpawnTemplate, Groupname )
|
|||||||
SpawnTemplate.CountryID = nil
|
SpawnTemplate.CountryID = nil
|
||||||
SpawnTemplate.CategoryID = nil
|
SpawnTemplate.CategoryID = nil
|
||||||
|
|
||||||
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID, Groupname )
|
self:_RegisterGroupTemplate( SpawnTemplate, SpawnCoalitionID, SpawnCategoryID, SpawnCountryID )
|
||||||
|
|
||||||
self:T3( SpawnTemplate )
|
self:T3( SpawnTemplate )
|
||||||
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
|
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
|
||||||
|
|||||||
@@ -1301,8 +1301,7 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold)
|
|||||||
local wp={}
|
local wp={}
|
||||||
wp[1]=self.group:GetCoordinate():WaypointAir(nil, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.FlyoverPoint,SpeedTo, true , nil, {}, "Current Pos")
|
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[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[3]=coordAB:WaypointAirLanding(SpeedHold, airbase, {}, "Landing")
|
||||||
wp[4]=coordAB:WaypointAirLanding(SpeedHold, airbase, {}, "Landing")
|
|
||||||
|
|
||||||
local respawn=true
|
local respawn=true
|
||||||
|
|
||||||
@@ -1316,13 +1315,12 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold)
|
|||||||
|
|
||||||
MESSAGE:New("Respawning group"):ToAll()
|
MESSAGE:New("Respawning group"):ToAll()
|
||||||
|
|
||||||
|
|
||||||
--Respawn the group.
|
--Respawn the group.
|
||||||
self.group=self.group:Respawn(Template, nil)
|
self.group=self.group:Respawn(Template, true)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.group:Route(wp, 0.1)
|
--self.group:Route(wp, 1)
|
||||||
|
|
||||||
--self:RouteRTB(RTBAirbase,Speed,Altitude,TaskOverhead)
|
--self:RouteRTB(RTBAirbase,Speed,Altitude,TaskOverhead)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1639,7 +1639,7 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
self:F(GroupUnit:GetName())
|
self:F(GroupUnit:GetName())
|
||||||
|
|
||||||
if GroupUnit:IsAlive() then
|
if GroupUnit:IsAlive() then
|
||||||
self:F("Alive")
|
self:I("FF Alive")
|
||||||
|
|
||||||
-- Get unit position vector.
|
-- Get unit position vector.
|
||||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||||
@@ -1739,8 +1739,8 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
local coord=unit:GetCoordinate()
|
local coord=unit:GetCoordinate()
|
||||||
local heading=unit:GetHeading()
|
local heading=unit:GetHeading()
|
||||||
Unit.x=coord.x
|
Unit.x=coord.x
|
||||||
Unit.z=coord.y
|
Unit.y=coord.z
|
||||||
Unit.alt=coord.alt
|
Unit.alt=coord.y
|
||||||
Unit.heading=math.rad(heading)
|
Unit.heading=math.rad(heading)
|
||||||
Unit.psi=-Unit.heading
|
Unit.psi=-Unit.heading
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user