Fixing issue #1054 related to ZONE_CAPTURE_COALITION going into Attacked state when the zone is attacked, meaning, when a unit is hit that is in the zone.

This commit is contained in:
FlightControl
2018-11-14 20:01:29 +01:00
parent c5ce3342e2
commit 9481cbf7e8
2 changed files with 52 additions and 0 deletions

View File

@@ -545,6 +545,10 @@ do -- ZONE_CAPTURE_COALITION
-- @param #ZONE_CAPTURE_COALITION self
-- @param #number Delay
-- We check if a unit within the zone is hit.
-- If it is, then we must move the zone to attack state.
self:HandleEvent( EVENTS.Hit, self.OnEventHit )
return self
end
@@ -789,5 +793,20 @@ do -- ZONE_CAPTURE_COALITION
end
end
--- @param #ZONE_CAPTURE_COALITION self
-- @param Core.Event#EVENTDATA EventData The event data.
function ZONE_CAPTURE_COALITION:OnEventHit( EventData )
local UnitHit = EventData.TgtUnit
if UnitHit then
if UnitHit:IsInZone( self.Zone ) then
self:Attack()
end
end
end
end