mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Optimized the detection intervals + fixed bugs with player detection.
This commit is contained in:
@@ -564,10 +564,12 @@ do -- DETECTION_BASE
|
||||
-- Count alive(!) groups only. Solves issue #1173 https://github.com/FlightControl-Master/MOOSE/issues/1173
|
||||
self.DetectionCount = self:CountAliveRecce()
|
||||
|
||||
local DetectionInterval = self.DetectionCount / ( self.RefreshTimeInterval - 1 )
|
||||
|
||||
self:ForEachAliveRecce(
|
||||
function( DetectionGroup )
|
||||
self:__Detection( DetectDelay, DetectionGroup, DetectionTimeStamp ) -- Process each detection asynchronously.
|
||||
DetectDelay = DetectDelay + 1
|
||||
DetectDelay = DetectDelay + DetectionInterval
|
||||
end
|
||||
)
|
||||
|
||||
@@ -1430,14 +1432,14 @@ do -- DETECTION_BASE
|
||||
world.searchObjects( Object.Category.UNIT, SphereSearch, FindNearByFriendlies, TargetData )
|
||||
|
||||
DetectedItem.PlayersNearBy = nil
|
||||
local DetectionZone = ZONE_UNIT:New( "DetectionPlayers", DetectedUnit, self.FriendliesRange )
|
||||
|
||||
_DATABASE:ForEachPlayer(
|
||||
--- @param Wrapper.Unit#UNIT PlayerUnit
|
||||
function( PlayerUnitName )
|
||||
local PlayerUnit = UNIT:FindByName( PlayerUnitName )
|
||||
|
||||
if PlayerUnit and PlayerUnit:IsInZone(DetectionZone) then
|
||||
if PlayerUnit and PlayerUnit:GetCoordinate():IsInRadius( DetectedUnitCoord, self.FriendliesRange ) then
|
||||
--if PlayerUnit and PlayerUnit:IsInZone(DetectionZone) then
|
||||
|
||||
local PlayerUnitCategory = PlayerUnit:GetDesc().category
|
||||
|
||||
|
||||
Reference in New Issue
Block a user