Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FlightControl-User committed Oct 18, 2018
2 parents 9ecd48f + 90e7688 commit a22b9e9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Moose Development/Moose/AI/AI_Cargo_APC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function AI_CARGO_APC:SetCarrier( CargoCarrier )
self.CargoCarrier:SetState( self.CargoCarrier, "AI_CARGO_APC", self )

CargoCarrier:HandleEvent( EVENTS.Dead )
CargoCarrier:HandleEvent( EVENTS.Hit )

function CargoCarrier:OnEventDead( EventData )
self:F({"dead"})
Expand All @@ -133,18 +132,20 @@ function AI_CARGO_APC:SetCarrier( CargoCarrier )
end
end
end

function CargoCarrier:OnEventHit( EventData )
self:F({"hit"})
local AICargoTroops = self:GetState( self, "AI_CARGO_APC" )
if AICargoTroops then
self:F( { OnHitLoaded = AICargoTroops:Is( "Loaded" ) } )
if AICargoTroops:Is( "Loaded" ) or AICargoTroops:Is( "Boarding" ) then
-- There are enemies within combat radius. Unload the CargoCarrier.
AICargoTroops:Unload( false )
end
end
end

-- CargoCarrier:HandleEvent( EVENTS.Hit )
--
-- function CargoCarrier:OnEventHit( EventData )
-- self:F({"hit"})
-- local AICargoTroops = self:GetState( self, "AI_CARGO_APC" )
-- if AICargoTroops then
-- self:F( { OnHitLoaded = AICargoTroops:Is( "Loaded" ) } )
-- if AICargoTroops:Is( "Loaded" ) or AICargoTroops:Is( "Boarding" ) then
-- -- There are enemies within combat radius. Unload the CargoCarrier.
-- AICargoTroops:Unload( false )
-- end
-- end
-- end

self.Zone = ZONE_UNIT:New( self.CargoCarrier:GetName() .. "-Zone", self.CargoCarrier, self.CombatRadius )
self.Coalition = self.CargoCarrier:GetCoalition()
Expand Down

0 comments on commit a22b9e9

Please sign in to comment.