Replace abused Map.ActorsInBox calls by Map.ActorsInWorld in all ra missions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = Map.ActorsInBox(NWIdlePoint.CenterPosition, Map.BottomRight, function(actor)
|
||||
local lazyUnits = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||
return actor.HasProperty("Hunt") and (actor.Owner == GoodGuy or actor.Owner == Greece) end)
|
||||
|
||||
Utils.Do(lazyUnits, function(unit)
|
||||
@@ -12,7 +12,8 @@ IdlingUnits = function()
|
||||
end)
|
||||
end
|
||||
|
||||
BaseBuildings = {
|
||||
BaseBuildings =
|
||||
{
|
||||
{ type = "powr", pos = CVec.New(3, -2), cost = 300 },
|
||||
{ type = "tent", pos = CVec.New(0, 4), cost = 400 },
|
||||
{ type = "hbox", pos = CVec.New(3, 6), cost = 600 },
|
||||
|
||||
@@ -15,11 +15,7 @@ CheckForCYard = function()
|
||||
end
|
||||
|
||||
CheckForSPen = function()
|
||||
SPens = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
|
||||
return actor.Type == "spen"
|
||||
end)
|
||||
|
||||
return #SPens >=1
|
||||
return Utils.Any(Map.ActorsInWorld, function(actor) return actor.Type == "spen" end)
|
||||
end
|
||||
|
||||
RunInitialActivities = function()
|
||||
@@ -36,7 +32,7 @@ RunInitialActivities = function()
|
||||
IdlingUnits()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
|
||||
local buildings = Map.ActorsInBox(NWIdlePoint.CenterPosition, Map.BottomRight, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then
|
||||
|
||||
Reference in New Issue
Block a user