This commit is contained in:
FlightControl 2017-04-02 09:16:34 +02:00
parent 2e2aabdcc9
commit f8f68ea695

View File

@ -93,7 +93,7 @@ do -- TASK_CARGO
Fsm:AddTransition( "WaitingForCommand", "RouteToDeploy", "RoutingToDeploy" )
Fsm:AddProcess ( "RoutingToDeploy", "RouteToDeployZone", ACT_ROUTE_ZONE:New(), { Arrived = "ArriveAtDeploy" } )
Fsm:AddTransition( "ArrivedAtDeploy", "ArriveAtDeploy", "ArrivedAtDeploy" )
Fsm:AddTransition( "Arrived", "ArriveAtDeploy", "ArrivedAtDeploy" )
Fsm:AddTransition( { "ArrivedAtPickup", "ArrivedAtDeploy" }, "Land", "Landing" )
Fsm:AddTransition( "Landing", "Landed", "Landed" )
@ -222,15 +222,11 @@ do -- TASK_CARGO
function Fsm:onafterArriveAtPickup( TaskUnit, Task )
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
if TaskUnit:IsAir() then
self:__Land( -0.1 )
else
self:__SelectAction( -0.1 )
end
else
self:__ArriveAtPickup( -10 )
end
end
@ -254,15 +250,11 @@ do -- TASK_CARGO
function Fsm:onafterArriveAtDeploy( TaskUnit, Task )
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
if TaskUnit:IsInZone( self.DeployZone ) then
if TaskUnit:IsAir() then
self:__Land( -0.1 )
else
self:__SelectAction( -0.1 )
end
else
self:__ArriveAtDeploy( -10 )
end
end