mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Re-added filtering duplicates, now keeps a duplicate if the rayType is different
This commit is contained in:
@@ -357,9 +357,10 @@ end
|
|||||||
function RADAR:RemoveDuplicateCapturedVehicles()
|
function RADAR:RemoveDuplicateCapturedVehicles()
|
||||||
for k, vehTable in pairs( self.capturedVehicles ) do
|
for k, vehTable in pairs( self.capturedVehicles ) do
|
||||||
local veh = vehTable.veh
|
local veh = vehTable.veh
|
||||||
|
local rt = vehTable.rayType
|
||||||
|
|
||||||
for b, v in pairs( self.capturedVehicles ) do
|
for b, v in pairs( self.capturedVehicles ) do
|
||||||
if ( v.veh == veh and k ~= b ) then table.remove( self.capturedVehicles, b ) end
|
if ( v.veh == veh and k ~= b and rt == v.rayType ) then table.remove( self.capturedVehicles, b ) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -679,7 +680,7 @@ function RADAR:Main()
|
|||||||
elseif ( self:GetRadarStage() == 1 ) then
|
elseif ( self:GetRadarStage() == 1 ) then
|
||||||
UTIL:DebugPrint( "Radar stage now 1." )
|
UTIL:DebugPrint( "Radar stage now 1." )
|
||||||
|
|
||||||
-- self:RemoveDuplicateCapturedVehicles()
|
self:RemoveDuplicateCapturedVehicles()
|
||||||
local caughtVehs = self:GetCapturedVehicles()
|
local caughtVehs = self:GetCapturedVehicles()
|
||||||
|
|
||||||
if ( not UTIL:IsTableEmpty( caughtVehs ) ) then
|
if ( not UTIL:IsTableEmpty( caughtVehs ) ) then
|
||||||
|
|||||||
Reference in New Issue
Block a user