mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
OPSGROUP
- Ad infinitum fixes - Turn into wind fixes
This commit is contained in:
parent
538864519e
commit
0b5edfc21f
@ -589,10 +589,11 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number. Default is next waypoint.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
-- @param #number Speed Speed in knots. Default cruise speed.
|
-- @param #number Speed Speed in knots. Default cruise speed.
|
||||||
-- @param #number Formation Formation of the group.
|
-- @param #number Formation Formation of the group.
|
||||||
function ARMYGROUP:onbeforeUpdateRoute(From, Event, To, n, Speed, Formation)
|
function ARMYGROUP:onbeforeUpdateRoute(From, Event, To, n, N, Speed, Formation)
|
||||||
if self:IsWaiting() then
|
if self:IsWaiting() then
|
||||||
self:E(self.lid.."Update route denied. Group is WAIRING!")
|
self:E(self.lid.."Update route denied. Group is WAIRING!")
|
||||||
return false
|
return false
|
||||||
@ -614,20 +615,22 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number. Default is next waypoint.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
-- @param #number Speed Speed in knots. Default cruise speed.
|
-- @param #number Speed Speed in knots. Default cruise speed.
|
||||||
-- @param #number Formation Formation of the group.
|
-- @param #number Formation Formation of the group.
|
||||||
function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Formation)
|
function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation)
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
local text=string.format("Update route state=%s: n=%s, Speed=%s, Formation=%s", self:GetState(), tostring(n), tostring(Speed), tostring(Formation))
|
local text=string.format("Update route state=%s: n=%s, N=%s, Speed=%s, Formation=%s", self:GetState(), tostring(n), tostring(N), tostring(Speed), tostring(Formation))
|
||||||
self:T(self.lid..text)
|
self:T(self.lid..text)
|
||||||
|
|
||||||
-- Update route from this waypoint number onwards.
|
-- Update route from this waypoint number onwards.
|
||||||
n=n or self:GetWaypointIndexNext(self.adinfinitum)
|
n=n or self:GetWaypointIndexNext(self.adinfinitum)
|
||||||
|
|
||||||
-- Update waypoint tasks, i.e. inject WP tasks into waypoint table. OBSOLETE!
|
-- Max index.
|
||||||
--self:_UpdateWaypointTasks(n)
|
N=N or #self.waypoints
|
||||||
|
N=math.min(N, #self.waypoints)
|
||||||
|
|
||||||
-- Waypoints.
|
-- Waypoints.
|
||||||
local waypoints={}
|
local waypoints={}
|
||||||
@ -740,26 +743,13 @@ function ARMYGROUP:onafterGotoWaypoint(From, Event, To, UID, Speed, Formation)
|
|||||||
|
|
||||||
local n=self:GetWaypointIndex(UID)
|
local n=self:GetWaypointIndex(UID)
|
||||||
|
|
||||||
--env.info(string.format("FF AG Goto waypoint UID=%s Index=%s, Speed=%s, Formation=%s", tostring(UID), tostring(n), tostring(Speed), tostring(Formation)))
|
|
||||||
|
|
||||||
if n then
|
if n then
|
||||||
|
|
||||||
-- TODO: switch to re-enable waypoint tasks.
|
|
||||||
if false then
|
|
||||||
local tasks=self:GetTasksWaypoint(n)
|
|
||||||
|
|
||||||
for _,_task in pairs(tasks) do
|
|
||||||
local task=_task --Ops.OpsGroup#OPSGROUP.Task
|
|
||||||
task.status=OPSGROUP.TaskStatus.SCHEDULED
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Speed to waypoint.
|
-- Speed to waypoint.
|
||||||
Speed=Speed or self:GetSpeedToWaypoint(n)
|
Speed=Speed or self:GetSpeedToWaypoint(n)
|
||||||
|
|
||||||
-- Update the route.
|
-- Update the route.
|
||||||
self:UpdateRoute(n, Speed, Formation)
|
self:__UpdateRoute(-0.01, n, nil, Speed, Formation)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1132,7 +1122,7 @@ function ARMYGROUP:onafterCruise(From, Event, To, Speed, Formation)
|
|||||||
self.Twaiting=nil
|
self.Twaiting=nil
|
||||||
self.dTwait=nil
|
self.dTwait=nil
|
||||||
|
|
||||||
self:__UpdateRoute(-1, nil, Speed, Formation)
|
self:__UpdateRoute(-1, nil, nil, Speed, Formation)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1970,9 +1970,10 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
-- @return #boolean Transision allowed?
|
-- @return #boolean Transision allowed?
|
||||||
function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n)
|
function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n, N)
|
||||||
|
|
||||||
-- Is transition allowed? We assume yes until proven otherwise.
|
-- Is transition allowed? We assume yes until proven otherwise.
|
||||||
local allowed=true
|
local allowed=true
|
||||||
@ -2012,8 +2013,8 @@ function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n)
|
|||||||
allowed=false
|
allowed=false
|
||||||
end
|
end
|
||||||
|
|
||||||
local N=n or self.currentwp+1
|
local Nn=n or self.currentwp+1
|
||||||
if not N or N<1 then
|
if not Nn or Nn<1 then
|
||||||
self:E(self.lid.."Update route denied because N=nil or N<1")
|
self:E(self.lid.."Update route denied because N=nil or N<1")
|
||||||
trepeat=-5
|
trepeat=-5
|
||||||
allowed=false
|
allowed=false
|
||||||
@ -2071,14 +2072,16 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number. Default is next waypoint.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n)
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
|
function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n, N)
|
||||||
|
|
||||||
-- Update route from this waypoint number onwards.
|
-- Update route from this waypoint number onwards.
|
||||||
n=n or self.currentwp+1
|
n=n or self.currentwp+1
|
||||||
|
|
||||||
-- Update waypoint tasks, i.e. inject WP tasks into waypoint table.
|
-- Max index.
|
||||||
self:_UpdateWaypointTasks(n)
|
N=N or #self.waypoints
|
||||||
|
N=math.min(N, #self.waypoints)
|
||||||
|
|
||||||
-- Waypoints.
|
-- Waypoints.
|
||||||
local wp={}
|
local wp={}
|
||||||
@ -2100,10 +2103,8 @@ function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n)
|
|||||||
local current=self.group:GetCoordinate():WaypointAir(COORDINATE.WaypointAltType.BARO, waypointType, waypointAction, speed, true, nil, {}, "Current")
|
local current=self.group:GetCoordinate():WaypointAir(COORDINATE.WaypointAltType.BARO, waypointType, waypointAction, speed, true, nil, {}, "Current")
|
||||||
table.insert(wp, current)
|
table.insert(wp, current)
|
||||||
|
|
||||||
local Nwp=self.waypoints and #self.waypoints or 0
|
|
||||||
|
|
||||||
-- Add remaining waypoints to route.
|
-- Add remaining waypoints to route.
|
||||||
for i=n, Nwp do
|
for i=n, N do
|
||||||
table.insert(wp, self.waypoints[i])
|
table.insert(wp, self.waypoints[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -710,12 +710,13 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number. Default is next waypoint.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
-- @param #number Speed Speed in knots to the next waypoint.
|
-- @param #number Speed Speed in knots to the next waypoint.
|
||||||
-- @param #number Depth Depth in meters to the next waypoint.
|
-- @param #number Depth Depth in meters to the next waypoint.
|
||||||
function NAVYGROUP:onbeforeUpdateRoute(From, Event, To, n, Speed, Depth)
|
function NAVYGROUP:onbeforeUpdateRoute(From, Event, To, n, Speed, Depth)
|
||||||
if self:IsWaiting() then
|
if self:IsWaiting() then
|
||||||
self:E(self.lid.."Update route denied. Group is WAIRING!")
|
self:E(self.lid.."Update route denied. Group is WAITING!")
|
||||||
return false
|
return false
|
||||||
elseif self:IsInUtero() then
|
elseif self:IsInUtero() then
|
||||||
self:E(self.lid.."Update route denied. Group is INUTERO!")
|
self:E(self.lid.."Update route denied. Group is INUTERO!")
|
||||||
@ -735,21 +736,24 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number n Waypoint number. Default is next waypoint.
|
-- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last.
|
||||||
|
-- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint.
|
||||||
-- @param #number Speed Speed in knots to the next waypoint.
|
-- @param #number Speed Speed in knots to the next waypoint.
|
||||||
-- @param #number Depth Depth in meters to the next waypoint.
|
-- @param #number Depth Depth in meters to the next waypoint.
|
||||||
function NAVYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Depth)
|
function NAVYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Depth)
|
||||||
|
|
||||||
-- Update route from this waypoint number onwards.
|
-- Update route from this waypoint number onwards.
|
||||||
n=n or self:GetWaypointIndexNext()
|
n=n or self:GetWaypointIndexNext()
|
||||||
|
|
||||||
-- Update waypoint tasks, i.e. inject WP tasks into waypoint table.
|
-- Max index.
|
||||||
--self:_UpdateWaypointTasks(n)
|
N=N or #self.waypoints
|
||||||
|
N=math.min(N, #self.waypoints)
|
||||||
|
|
||||||
|
|
||||||
-- Waypoints.
|
-- Waypoints.
|
||||||
local waypoints={}
|
local waypoints={}
|
||||||
|
|
||||||
for i=n, #self.waypoints do
|
for i=n, N do
|
||||||
|
|
||||||
-- Waypoint.
|
-- Waypoint.
|
||||||
local wp=UTILS.DeepCopy(self.waypoints[i]) --Ops.OpsGroup#OPSGROUP.Waypoint
|
local wp=UTILS.DeepCopy(self.waypoints[i]) --Ops.OpsGroup#OPSGROUP.Waypoint
|
||||||
@ -956,7 +960,8 @@ function NAVYGROUP:onafterTurnIntoWindOver(From, Event, To, IntoWindData)
|
|||||||
-- ID of current waypoint.
|
-- ID of current waypoint.
|
||||||
local uid=self:GetWaypointCurrent().uid
|
local uid=self:GetWaypointCurrent().uid
|
||||||
|
|
||||||
self:AddWaypoint(self.intowind.Coordinate, self:GetSpeedCruise(), uid)
|
-- Add temp waypoint.
|
||||||
|
local wp=self:AddWaypoint(self.intowind.Coordinate, self:GetSpeedCruise(), uid) ; wp.temp=true
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -966,11 +971,11 @@ function NAVYGROUP:onafterTurnIntoWindOver(From, Event, To, IntoWindData)
|
|||||||
|
|
||||||
-- Next waypoint index and speed.
|
-- Next waypoint index and speed.
|
||||||
local indx=self:GetWaypointIndexNext()
|
local indx=self:GetWaypointIndexNext()
|
||||||
local speed=self:GetWaypointSpeed(indx)
|
local speed=self:GetSpeedToWaypoint(indx)
|
||||||
|
|
||||||
-- Update route.
|
-- Update route.
|
||||||
self:T(self.lid..string.format("FF Turn Into Wind Over ==> Next WP Index=%d at %.1f knots via update route!", indx, speed))
|
self:T(self.lid..string.format("FF Turn Into Wind Over ==> Next WP Index=%d at %.1f knots via update route!", indx, speed))
|
||||||
self:__UpdateRoute(-1, indx, speed)
|
self:__UpdateRoute(-1, indx, nil, speed)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1018,7 +1023,7 @@ function NAVYGROUP:onafterCruise(From, Event, To, Speed)
|
|||||||
-- No set depth.
|
-- No set depth.
|
||||||
self.depth=nil
|
self.depth=nil
|
||||||
|
|
||||||
self:__UpdateRoute(-1, nil, Speed)
|
self:__UpdateRoute(-1, nil, nil, Speed)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1037,7 +1042,7 @@ function NAVYGROUP:onafterDive(From, Event, To, Depth, Speed)
|
|||||||
|
|
||||||
self.depth=Depth
|
self.depth=Depth
|
||||||
|
|
||||||
self:__UpdateRoute(-1, nil, Speed)
|
self:__UpdateRoute(-1, nil, nil, Speed)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1051,7 +1056,7 @@ function NAVYGROUP:onafterSurface(From, Event, To, Speed)
|
|||||||
|
|
||||||
self.depth=0
|
self.depth=0
|
||||||
|
|
||||||
self:__UpdateRoute(-1, nil, Speed)
|
self:__UpdateRoute(-1, nil, nil, Speed)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2411,7 +2411,7 @@ function OPSGROUP:GetSpeedToWaypoint(indx)
|
|||||||
|
|
||||||
local speed=self:GetWaypointSpeed(indx)
|
local speed=self:GetWaypointSpeed(indx)
|
||||||
|
|
||||||
if speed<=0.1 then
|
if speed<=0.01 then
|
||||||
speed=self:GetSpeedCruise()
|
speed=self:GetSpeedCruise()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4333,6 +4333,10 @@ function OPSGROUP:onafterPassingWaypoint(From, Event, To, Waypoint)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if task and task.dcstask.id=="PatrolZone" then
|
if task and task.dcstask.id=="PatrolZone" then
|
||||||
|
|
||||||
|
---
|
||||||
|
-- SPECIAL TASK: Patrol Zone
|
||||||
|
---
|
||||||
|
|
||||||
-- Remove old waypoint.
|
-- Remove old waypoint.
|
||||||
self:RemoveWaypointByID(Waypoint.uid)
|
self:RemoveWaypointByID(Waypoint.uid)
|
||||||
@ -4360,6 +4364,10 @@ function OPSGROUP:onafterPassingWaypoint(From, Event, To, Waypoint)
|
|||||||
wp.missionUID=mission and mission.auftragsnummer or nil
|
wp.missionUID=mission and mission.auftragsnummer or nil
|
||||||
|
|
||||||
elseif task and task.dcstask.id=="ReconMission" then
|
elseif task and task.dcstask.id=="ReconMission" then
|
||||||
|
|
||||||
|
---
|
||||||
|
-- SPECIAL TASK: Recon Mission
|
||||||
|
---
|
||||||
|
|
||||||
local target=task.dcstask.params.target --Ops.Target#TARGET
|
local target=task.dcstask.params.target --Ops.Target#TARGET
|
||||||
|
|
||||||
@ -4412,7 +4420,7 @@ function OPSGROUP:onafterPassingWaypoint(From, Event, To, Waypoint)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Final zone reached ==> task done.
|
-- Final zone reached ==> task done.
|
||||||
self:TaskDone(task)
|
self:TaskDone(task)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4431,24 +4439,41 @@ function OPSGROUP:onafterPassingWaypoint(From, Event, To, Waypoint)
|
|||||||
-- Final waypoint reached?
|
-- Final waypoint reached?
|
||||||
if wpindex==nil or wpindex==#self.waypoints then
|
if wpindex==nil or wpindex==#self.waypoints then
|
||||||
|
|
||||||
-- Set switch to true.
|
-- Ad infinitum?
|
||||||
if self.adinfinitum then
|
if self.adinfinitum then
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Ad Infinitum and last waypoint reached.
|
||||||
|
---
|
||||||
|
|
||||||
if #self.waypoints<=1 then
|
if #self.waypoints<=1 then
|
||||||
|
-- Only one waypoint. Ad infinitum does not really make sense. However, another waypoint could be added later...
|
||||||
self:_PassedFinalWaypoint(true, "PassingWaypoint: adinfinitum but only ONE WAYPOINT left")
|
self:_PassedFinalWaypoint(true, "PassingWaypoint: adinfinitum but only ONE WAYPOINT left")
|
||||||
else
|
else
|
||||||
local uid=self:GetWaypointID(1)
|
|
||||||
self:GotoWaypoint(uid)
|
-- Looks like the passing waypoint function is triggered over and over again if the group is near the final waypoint.
|
||||||
end
|
-- So the only good solution is to guide the group away from that waypoint and then update the route.
|
||||||
else
|
|
||||||
self:_PassedFinalWaypoint(true, "PassingWaypoint: wpindex=nil or wpindex=#self.waypoints")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
-- Get first waypoint.
|
||||||
|
local wp1=self:GetWaypointByIndex(1)
|
||||||
|
|
||||||
|
-- Get a waypoint
|
||||||
|
local Coordinate=Waypoint.coordinate:GetIntermediateCoordinate(wp1.coordinate, 0.1)
|
||||||
|
|
||||||
|
-- Detour to the temp waypoint. When reached, the normal route is resumed.
|
||||||
|
self:Detour(Coordinate, self.speedCruise, nil, true)
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- Final waypoint reached.
|
||||||
|
self:_PassedFinalWaypoint(true, "PassingWaypoint: wpindex=#self.waypoints (or wpindex=nil)")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Passing mission waypoint?
|
-- Passing mission waypoint?
|
||||||
if Waypoint.missionUID then
|
if Waypoint.missionUID then
|
||||||
self:T(self.lid.."FF passing mission waypoint")
|
self:T(self.lid.."FF passing mission waypoint")
|
||||||
--self:RemoveWaypointByID(Waypoint.uid)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if all tasks/mission are done?
|
-- Check if all tasks/mission are done?
|
||||||
@ -4537,7 +4562,7 @@ function OPSGROUP:onafterPassedFinalWaypoint(From, Event, To)
|
|||||||
self:T(self.lid..string.format("Group passed final waypoint"))
|
self:T(self.lid..string.format("Group passed final waypoint"))
|
||||||
|
|
||||||
-- Check if group is done? No tasks mission running.
|
-- Check if group is done? No tasks mission running.
|
||||||
self:_CheckGroupDone()
|
--self:_CheckGroupDone()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -4547,28 +4572,22 @@ end
|
|||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param #number UID The goto waypoint unique ID.
|
-- @param #number UID The goto waypoint unique ID.
|
||||||
function OPSGROUP:onafterGotoWaypoint(From, Event, To, UID)
|
-- @param #number Speed (Optional) Speed to waypoint in knots.
|
||||||
|
function OPSGROUP:onafterGotoWaypoint(From, Event, To, UID, Speed)
|
||||||
|
|
||||||
local n=self:GetWaypointIndex(UID)
|
local n=self:GetWaypointIndex(UID)
|
||||||
|
|
||||||
if n then
|
if n then
|
||||||
|
|
||||||
-- TODO: Switch to re-enable waypoint tasks?
|
-- Speed to waypoint.
|
||||||
if false then
|
Speed=Speed or self:GetSpeedToWaypoint(n)
|
||||||
local tasks=self:GetTasksWaypoint(n)
|
|
||||||
|
-- Debug message
|
||||||
for _,_task in pairs(tasks) do
|
self:T(self.lid..string.format("Goto Waypoint UID=%d index=%d from %d at speed %.1f knots", UID, n, self.currentwp, Speed))
|
||||||
local task=_task --#OPSGROUP.Task
|
|
||||||
task.status=OPSGROUP.TaskStatus.SCHEDULED
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
local Speed=self:GetSpeedToWaypoint(n)
|
|
||||||
|
|
||||||
-- Update the route.
|
-- Update the route.
|
||||||
self:__UpdateRoute(-1, n, Speed)
|
self:__UpdateRoute(-0.01, n, nil, Speed)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -6826,16 +6845,7 @@ function OPSGROUP:onafterTransport(From, Event, To)
|
|||||||
else
|
else
|
||||||
|
|
||||||
-- Coord where the carrier goes to unload.
|
-- Coord where the carrier goes to unload.
|
||||||
local Coordinate=nil --Core.Point#COORDINATE
|
local Coordinate=Zone:GetRandomCoordinate() --Core.Point#COORDINATE
|
||||||
|
|
||||||
if self.cargoTransport.carrierGroup and self.cargoTransport.carrierGroup:IsLoading() then
|
|
||||||
--TODO: What the heck is self.cargoTransport.carrierGroup and where is this set?!
|
|
||||||
-- Coordinate of the new carrier.
|
|
||||||
Coordinate=self.cargoTransport.carrierGroup:GetCoordinate()
|
|
||||||
else
|
|
||||||
-- Get a random coordinate in the deploy zone and let the carrier go there.
|
|
||||||
Coordinate=Zone:GetRandomCoordinate()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add waypoint.
|
-- Add waypoint.
|
||||||
if self:IsFlightgroup() then
|
if self:IsFlightgroup() then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user