mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Strange Things!
This commit is contained in:
parent
762ce9a6b1
commit
954ca31c79
@ -615,13 +615,16 @@ AI_CARGO_DISPATCHER.PickupCargo = {}
|
|||||||
-- AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet )
|
-- AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet )
|
||||||
-- AICargoDispatcherAirplanes:Start()
|
-- AICargoDispatcherAirplanes:Start()
|
||||||
--
|
--
|
||||||
function AI_CARGO_DISPATCHER:New( SetCarrier, SetCargo )
|
function AI_CARGO_DISPATCHER:New( SetCarrier, SetCargo, PickupZoneSet, DeployZoneSet )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, FSM:New() ) -- #AI_CARGO_DISPATCHER
|
local self = BASE:Inherit( self, FSM:New() ) -- #AI_CARGO_DISPATCHER
|
||||||
|
|
||||||
self.SetCarrier = SetCarrier -- Core.Set#SET_GROUP
|
self.SetCarrier = SetCarrier -- Core.Set#SET_GROUP
|
||||||
self.SetCargo = SetCargo -- Core.Set#SET_CARGO
|
self.SetCargo = SetCargo -- Core.Set#SET_CARGO
|
||||||
|
|
||||||
|
self.PickupZoneSet=PickupZoneSet
|
||||||
|
self.DeployZoneSet=DeployZoneSet
|
||||||
|
|
||||||
self:SetStartState( "Idle" )
|
self:SetStartState( "Idle" )
|
||||||
|
|
||||||
self:AddTransition( "Monitoring", "Monitor", "Monitoring" )
|
self:AddTransition( "Monitoring", "Monitor", "Monitoring" )
|
||||||
@ -1094,7 +1097,10 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
local CargoCoordinate = Cargo:GetCoordinate()
|
local CargoCoordinate = Cargo:GetCoordinate()
|
||||||
local CoordinateFree = true
|
local CoordinateFree = true
|
||||||
--self.PickupZoneSet:Flush()
|
--self.PickupZoneSet:Flush()
|
||||||
PickupZone = self.PickupZoneSet and self.PickupZoneSet:IsCoordinateInZone( CargoCoordinate )
|
env.info("FF pickupzoneset")
|
||||||
|
self:E(self.PickupZoneSet)
|
||||||
|
PickupZone = self.PickupZoneSet and self.PickupZoneSet:GetRandomZone():IsCoordinateInZone( CargoCoordinate )
|
||||||
|
self:E(PickupZone)
|
||||||
if not self.PickupZoneSet or PickupZone then
|
if not self.PickupZoneSet or PickupZone then
|
||||||
for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do
|
for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do
|
||||||
if CarrierPickup:IsAlive() == true then
|
if CarrierPickup:IsAlive() == true then
|
||||||
@ -1133,6 +1139,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
if PickupCargo then
|
if PickupCargo then
|
||||||
self.CarrierHome[Carrier] = nil
|
self.CarrierHome[Carrier] = nil
|
||||||
local PickupCoordinate = PickupCargo:GetCoordinate():GetRandomCoordinateInRadius( self.PickupOuterRadius, self.PickupInnerRadius )
|
local PickupCoordinate = PickupCargo:GetCoordinate():GetRandomCoordinateInRadius( self.PickupOuterRadius, self.PickupInnerRadius )
|
||||||
|
env.info("FF pickup zone = "..tostring(PickupZone:GetName()))
|
||||||
AI_Cargo:Pickup( PickupCoordinate, math.random( self.PickupMinSpeed, self.PickupMaxSpeed ), math.random( self.PickupMinHeight, self.PickupMaxHeight ), PickupZone )
|
AI_Cargo:Pickup( PickupCoordinate, math.random( self.PickupMinSpeed, self.PickupMaxSpeed ), math.random( self.PickupMinHeight, self.PickupMaxHeight ), PickupZone )
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user