Replace abused Map.ActorsInBox calls by Map.ActorsInWorld in all cnc missions
This commit is contained in:
@@ -26,7 +26,7 @@ getActors = function(owner, units)
|
|||||||
local maxUnits = 0
|
local maxUnits = 0
|
||||||
local actors = { }
|
local actors = { }
|
||||||
for type, count in pairs(units) do
|
for type, count in pairs(units) do
|
||||||
local globalActors = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local globalActors = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == owner and actor.Type == type and not actor.IsDead
|
return actor.Owner == owner and actor.Type == type and not actor.IsDead
|
||||||
end)
|
end)
|
||||||
if #globalActors < count then
|
if #globalActors < count then
|
||||||
@@ -234,7 +234,7 @@ Tick = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
checkProduction = function(player)
|
checkProduction = function(player)
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == player and actor.Type == UnitToRebuild
|
return actor.Owner == player and actor.Type == UnitToRebuild
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ checkProduction = function(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
getStartUnits = function()
|
getStartUnits = function()
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == enemy
|
return actor.Owner == enemy
|
||||||
end)
|
end)
|
||||||
Utils.Do(Units, function(unit)
|
Utils.Do(Units, function(unit)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ getActors = function(owner, units)
|
|||||||
local maxUnits = 0
|
local maxUnits = 0
|
||||||
local actors = { }
|
local actors = { }
|
||||||
for type, count in pairs(units) do
|
for type, count in pairs(units) do
|
||||||
local globalActors = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local globalActors = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == owner and actor.Type == type and not actor.IsDead
|
return actor.Owner == owner and actor.Type == type and not actor.IsDead
|
||||||
end)
|
end)
|
||||||
if #globalActors < count then
|
if #globalActors < count then
|
||||||
@@ -196,7 +196,7 @@ getActors = function(owner, units)
|
|||||||
end
|
end
|
||||||
|
|
||||||
checkProduction = function(player)
|
checkProduction = function(player)
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == player and actor.Type == UnitToRebuild
|
return actor.Owner == player and actor.Type == UnitToRebuild
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ checkProduction = function(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
getStartUnits = function()
|
getStartUnits = function()
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == enemy
|
return actor.Owner == enemy
|
||||||
end)
|
end)
|
||||||
Utils.Do(Units, function(unit)
|
Utils.Do(Units, function(unit)
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ CheckForSams = function(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
checkProduction = function(player)
|
checkProduction = function(player)
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == enemy
|
return actor.Owner == enemy
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ checkProduction = function(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
getStartUnits = function()
|
getStartUnits = function()
|
||||||
local Units = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
local Units = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||||
return actor.Owner == enemy and ( actor.Type == 'e2' or actor.Type == 'e1' or actor.Type == 'jeep' or actor.Type == 'mtnk')
|
return actor.Owner == enemy and ( actor.Type == 'e2' or actor.Type == 'e1' or actor.Type == 'jeep' or actor.Type == 'mtnk')
|
||||||
end)
|
end)
|
||||||
Utils.Do(Units, function(unit)
|
Utils.Do(Units, function(unit)
|
||||||
|
|||||||
Reference in New Issue
Block a user