This commit is contained in:
FlightControl
2019-03-21 05:21:16 +01:00
parent d9fb9c4928
commit e996a30333
3 changed files with 30 additions and 63 deletions

View File

@@ -1479,3 +1479,33 @@ function POSITIONABLE:SmokeBlue()
end
--- Returns true if the unit is within a @{Zone}.
-- @param #STPOSITIONABLEATIC self
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the unit is within the @{Core.Zone#ZONE_BASE}
function POSITIONABLE:IsInZone( Zone )
self:F2( { self.PositionableName, Zone } )
if self:IsAlive() then
local IsInZone = Zone:IsVec3InZone( self:GetVec3() )
return IsInZone
end
return false
end
--- Returns true if the unit is not within a @{Zone}.
-- @param #POSITIONABLE self
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the unit is not within the @{Core.Zone#ZONE_BASE}
function POSITIONABLE:IsNotInZone( Zone )
self:F2( { self.PositionableName, Zone } )
if self:IsAlive() then
local IsNotInZone = not Zone:IsVec3InZone( self:GetVec3() )
return IsNotInZone
else
return false
end
end