mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-11 11:48:38 +00:00
FC
This commit is contained in:
@@ -338,7 +338,8 @@ function FLIGHTGROUP:New(groupname)
|
||||
self:AddTransition("*", "UpdateRoute", "*") -- Update route of group. Only if airborne.
|
||||
self:AddTransition("*", "RTB", "Returning") -- Group is returning to base.
|
||||
self:AddTransition("*", "Orbit", "Orbiting") -- Group is holding position.
|
||||
self:AddTransition("*", "Hold", "Holding") -- Group is holding position.
|
||||
self:AddTransition("*", "Hold", "Inbound") -- Group is holding position.
|
||||
self:AddTransition("Inbound", "Holding", "Holding") -- Group is holding position.
|
||||
|
||||
self:AddTransition("*", "PassingWaypoint", "*") -- Group passed a waypoint.
|
||||
|
||||
@@ -1084,6 +1085,11 @@ function FLIGHTGROUP:OnEventEngineStartup(EventData)
|
||||
-- when player starts cold, ?
|
||||
if self.ai then
|
||||
self:ElementTaxiing(element)
|
||||
else
|
||||
if element.ai then
|
||||
-- AI wingmen will start taxiing even if the player/client is still starting up his engines :(
|
||||
self:ElementTaxiing(element)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1260,6 +1266,7 @@ function FLIGHTGROUP:onafterElementSpawned(From, Event, To, Element)
|
||||
if spot then
|
||||
|
||||
Element.parking=spot
|
||||
|
||||
|
||||
self:ElementParking(Element)
|
||||
else
|
||||
@@ -1277,6 +1284,7 @@ end
|
||||
function FLIGHTGROUP:onafterElementParking(From, Event, To, Element)
|
||||
self:T(self.sid..string.format("Element parking %s at spot %s.", Element.name, tostring(Element.parking.TerminalID)))
|
||||
|
||||
|
||||
-- Set element status.
|
||||
self:_UpdateStatus(Element, FLIGHTGROUP.ElementStatus.PARKING)
|
||||
end
|
||||
@@ -1642,12 +1650,6 @@ function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n)
|
||||
table.insert(wp, w)
|
||||
end
|
||||
|
||||
-- Get destination airbase from waypoints.
|
||||
self.homebase=self:GetHomebaseFromWaypoints() or self.homebase
|
||||
|
||||
-- Get destination airbase from waypoints.
|
||||
self.destination=self:GetDestinationFromWaypoints() or self.destination
|
||||
|
||||
if self.destination and #wp>0 and _DATABASE:GetFlightControl(self.destination:GetName()) then
|
||||
|
||||
-- Task to hold.
|
||||
@@ -1940,6 +1942,25 @@ function FLIGHTGROUP:onafterHold(From, Event, To, airbase, SpeedTo, SpeedHold, S
|
||||
|
||||
end
|
||||
|
||||
--- On after "Holding" event. Flight arrived at the holding point.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
function FLIGHTGROUP:onafterHolding(From, Event, To)
|
||||
|
||||
|
||||
self.flaghold:Set(666)
|
||||
|
||||
-- Add flight to waiting/holding queue.
|
||||
if self.flightcontrol then
|
||||
-- Add flight to all flights.
|
||||
--table.insert(flightgroup.flightcontrol.flights, flightgroup)
|
||||
self.flightcontrol:_AddFlightToHoldingQueue(self)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- On after TaskExecute event.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @param #string From From state.
|
||||
@@ -2268,14 +2289,7 @@ function FLIGHTGROUP._ReachedHolding(group, flightgroup)
|
||||
group:GetCoordinate():MarkToAll("Holding Point Reached")
|
||||
end
|
||||
|
||||
flightgroup.flaghold:Set(666)
|
||||
|
||||
-- Add flight to waiting/holding queue.
|
||||
if flightgroup.flightcontrol then
|
||||
-- Add flight to all flights.
|
||||
--table.insert(flightgroup.flightcontrol.flights, flightgroup)
|
||||
flightgroup.flightcontrol:_AddFlightToHoldingQueue(flightgroup)
|
||||
end
|
||||
flightgroup:__Holding(1)
|
||||
end
|
||||
|
||||
--- Update route of group, e.g after new waypoints and/or waypoint tasks have been added.
|
||||
@@ -2682,6 +2696,8 @@ function FLIGHTGROUP:InitWaypoints(waypoints)
|
||||
-- Set current waypoint. Counting starts a one.
|
||||
self.currentwp=1
|
||||
|
||||
|
||||
|
||||
-- Update route.
|
||||
if #self.waypoints>0 then
|
||||
self:__UpdateRoute(-0.1, 1)
|
||||
|
||||
Reference in New Issue
Block a user