This commit is contained in:
Frank 2018-09-24 10:00:43 +02:00
parent 954ca31c79
commit 483c5deddd
2 changed files with 6 additions and 6 deletions

View File

@ -272,7 +272,7 @@ function AI_CARGO_AIRPLANE:onafterPickup( Airplane, From, Event, To, Coordinate,
-- Get closest airbase of current position.
local ClosestAirbase, DistToAirbase=Airplane:GetCoordinate():GetClosestAirbase()
--env.info("FF onafterpickup closest airbase "..ClosestAirbase:GetName())
-- Two cases. Aircraft spawned in air or at an airbase.

View File

@ -112,6 +112,8 @@
--- @type AI_CARGO_DISPATCHER
-- @field Core.Set#SET_ZONE PickupZoneSet
-- @field Core.Set#SET_ZONE DeployZoneSet
-- @extends Core.Fsm#FSM
@ -557,6 +559,7 @@
AI_CARGO_DISPATCHER = {
ClassName = "AI_CARGO_DISPATCHER",
SetCarrier = nil,
PickupZoneSet = nil,
DeployZoneSet = nil,
AI_Cargo = {},
PickupCargo = {}
@ -1097,10 +1100,8 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
local CargoCoordinate = Cargo:GetCoordinate()
local CoordinateFree = true
--self.PickupZoneSet:Flush()
env.info("FF pickupzoneset")
self:E(self.PickupZoneSet)
PickupZone = self.PickupZoneSet and self.PickupZoneSet:GetRandomZone():IsCoordinateInZone( CargoCoordinate )
self:E(PickupZone)
PickupZone = self.PickupZoneSet:GetRandomZone()
--PickupZone = self.PickupZoneSet and self.PickupZoneSet:IsCoordinateInZone( CargoCoordinate )
if not self.PickupZoneSet or PickupZone then
for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do
if CarrierPickup:IsAlive() == true then
@ -1139,7 +1140,6 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
if PickupCargo then
self.CarrierHome[Carrier] = nil
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 )
break
else