mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #640 from FlightControl-Master/funkyfranky
Fixes for Group in Zone functions
This commit is contained in:
commit
a928a1c750
@ -574,6 +574,8 @@ do -- Is Zone methods
|
|||||||
function GROUP:IsCompletelyInZone( Zone )
|
function GROUP:IsCompletelyInZone( Zone )
|
||||||
self:F2( { self.GroupName, Zone } )
|
self:F2( { self.GroupName, Zone } )
|
||||||
|
|
||||||
|
if not self:IsAlive() then return false end
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||||
@ -595,6 +597,8 @@ function GROUP:IsPartlyInZone( Zone )
|
|||||||
local IsOneUnitInZone = false
|
local IsOneUnitInZone = false
|
||||||
local IsOneUnitOutsideZone = false
|
local IsOneUnitOutsideZone = false
|
||||||
|
|
||||||
|
if not self:IsAlive() then return false end
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||||
@ -618,6 +622,8 @@ end
|
|||||||
function GROUP:IsNotInZone( Zone )
|
function GROUP:IsNotInZone( Zone )
|
||||||
self:F2( { self.GroupName, Zone } )
|
self:F2( { self.GroupName, Zone } )
|
||||||
|
|
||||||
|
if not self:IsAlive() then return true end
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||||
@ -636,6 +642,8 @@ function GROUP:CountInZone( Zone )
|
|||||||
self:F2( {self.GroupName, Zone} )
|
self:F2( {self.GroupName, Zone} )
|
||||||
local Count = 0
|
local Count = 0
|
||||||
|
|
||||||
|
if not self:IsAlive() then return Count end
|
||||||
|
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
if Zone:IsVec3InZone( Unit:GetVec3() ) then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user