mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-20 07:43:07 +00:00
FG/FC
This commit is contained in:
@@ -1244,6 +1244,7 @@ function FLIGHTCONTROL:_PlayerRequestTakeoff(groupname)
|
|||||||
self:_AddFlightToTakeoffQueue(flight)
|
self:_AddFlightToTakeoffQueue(flight)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
MESSAGE:New(string.format("You must request TAXI before you can request TAKEOFF!"), 5):ToAll()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1282,7 +1283,7 @@ function FLIGHTCONTROL:_CreateFlightGroup(group)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Add to known flights.
|
-- Add to known flights.
|
||||||
table.insert(self.flights, flight)
|
--table.insert(self.flights, flight)
|
||||||
|
|
||||||
return flight
|
return flight
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -525,18 +525,23 @@ end
|
|||||||
-- @return #FLIGHTGROUP self
|
-- @return #FLIGHTGROUP self
|
||||||
function FLIGHTGROUP:SetFlightControl(flightcontrol)
|
function FLIGHTGROUP:SetFlightControl(flightcontrol)
|
||||||
self:I(self.sid..string.format("Setting FLIGHTCONTROL to airbase %s", flightcontrol.airbasename))
|
self:I(self.sid..string.format("Setting FLIGHTCONTROL to airbase %s", flightcontrol.airbasename))
|
||||||
|
|
||||||
-- Remove flight from previous FC.
|
-- Remove flight from previous FC.
|
||||||
if self.flightcontrol and self.flightcontrol.airbasename~=flightcontrol.airbasename then
|
if self.flightcontrol and self.flightcontrol.airbasename~=flightcontrol.airbasename then
|
||||||
self.flightcontrol:_RemoveFlight(self)
|
self.flightcontrol:_RemoveFlight(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set FC.
|
-- Set FC.
|
||||||
self.flightcontrol=flightcontrol
|
self.flightcontrol=flightcontrol
|
||||||
|
|
||||||
-- Add flight to all flights.
|
-- Add flight to all flights.
|
||||||
table.insert(flightcontrol.flights, self)
|
table.insert(flightcontrol.flights, self)
|
||||||
|
|
||||||
-- Update flight's F10 menu.
|
-- Update flight's F10 menu.
|
||||||
if self.ai==false then
|
if self.ai==false then
|
||||||
self:_UpdateMenu()
|
self:_UpdateMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1540,14 +1545,14 @@ function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n)
|
|||||||
|
|
||||||
if self.group and self.group:IsAlive() and self:IsAirborne() then
|
if self.group and self.group:IsAlive() and self:IsAirborne() then
|
||||||
-- Alive & Airborne ==> Update route possible.
|
-- Alive & Airborne ==> Update route possible.
|
||||||
self:I(self.sid.."FF update route allowed")
|
self:T2(self.sid.."Update route allowed")
|
||||||
return true
|
return true
|
||||||
elseif self:IsDead() then
|
elseif self:IsDead() then
|
||||||
-- Group is dead! No more updates.
|
-- Group is dead! No more updates.
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
-- Not airborne yet. Try again in 1 sec.
|
-- Not airborne yet. Try again in 1 sec.
|
||||||
self:I(self.sid.."FF update route denied ==> checking back in 1 sec")
|
self:T3(self.sid.."FF update route denied ==> checking back in 1 sec")
|
||||||
self:__UpdateRoute(-1, n)
|
self:__UpdateRoute(-1, n)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -1563,7 +1568,7 @@ end
|
|||||||
function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n)
|
function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n)
|
||||||
|
|
||||||
MESSAGE:New("Updating route", 10):ToAll()
|
MESSAGE:New("Updating route", 10):ToAll()
|
||||||
self:I(self.sid.."FF updating route")
|
self:I(self.sid.."Updating route")
|
||||||
|
|
||||||
-- TODO: what happens if currentwp=#waypoints
|
-- TODO: what happens if currentwp=#waypoints
|
||||||
n=n or self.currentwp+1
|
n=n or self.currentwp+1
|
||||||
@@ -2219,7 +2224,7 @@ function FLIGHTGROUP._ReachedHolding(group, flightgroup)
|
|||||||
-- Add flight to waiting/holding queue.
|
-- Add flight to waiting/holding queue.
|
||||||
if flightgroup.flightcontrol then
|
if flightgroup.flightcontrol then
|
||||||
-- Add flight to all flights.
|
-- Add flight to all flights.
|
||||||
table.insert(flightgroup.flightcontrol.flights, flightgroup)
|
--table.insert(flightgroup.flightcontrol.flights, flightgroup)
|
||||||
flightgroup.flightcontrol:_AddFlightToHoldingQueue(flightgroup)
|
flightgroup.flightcontrol:_AddFlightToHoldingQueue(flightgroup)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user