Merge pull request #9972 from Biofreak1987/fix_dead_cyard_ai_construction

Fix ai building in soviet04/06 missions despite killed construction yard
This commit is contained in:
Oliver Brakmann
2015-11-13 20:50:00 +01:00
4 changed files with 24 additions and 24 deletions

View File

@@ -23,12 +23,6 @@ BaseBuildings =
}
BuildBase = function()
if CYard.IsDead or CYard.Owner ~= Greece then
return
elseif Harvester.IsDead and Greece.Resources <= 299 then
return
end
for i,v in ipairs(BaseBuildings) do
if not v.exists then
BuildBuilding(v)
@@ -41,6 +35,12 @@ end
BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
if CYard.IsDead or CYard.Owner ~= Greece then
return
elseif Harvester.IsDead and Greece.Resources <= 299 then
return
end
local actor = Actor.Create(building.type, true, { Owner = Greece, Location = GreeceCYard.Location + building.pos })
Greece.Cash = Greece.Cash - building.cost

View File

@@ -19,12 +19,6 @@ BaseWeaponsFactory = { type = "weap", pos = CVec.New(-12, -1), cost = 2000, exis
BaseBuildings = { BasePower, BaseBarracks, BaseProc, BaseWeaponsFactory }
BuildBase = function()
if CYard.IsDead or CYard.Owner ~= Greece then
return
elseif Harvester.IsDead and Greece.Resources <= 299 then
return
end
for i,v in ipairs(BaseBuildings) do
if not v.exists then
BuildBuilding(v)
@@ -37,6 +31,12 @@ end
BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
if CYard.IsDead or CYard.Owner ~= Greece then
return
elseif Harvester.IsDead and Greece.Resources <= 299 then
return
end
local actor = Actor.Create(building.type, true, { Owner = Greece, Location = GreeceCYard.Location + building.pos })
Greece.Cash = Greece.Cash - building.cost

View File

@@ -20,12 +20,6 @@ BaseApwr2 = { type = "apwr", pos = CVec.New(-4, 1), cost = 500, exists = true }
BaseBuildings = { BaseApwr, BaseTent, BaseProc, BaseWeap, BaseApwr2 }
BuildBase = function()
if CYard.IsDead or CYard.Owner ~= enemy then
return
elseif Harvester.IsDead and enemy.Resources <= 299 then
return
end
for i,v in ipairs(BaseBuildings) do
if not v.exists then
BuildBuilding(v)
@@ -38,6 +32,12 @@ end
BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
if CYard.IsDead or CYard.Owner ~= enemy then
return
elseif Harvester.IsDead and enemy.Resources <= 299 then
return
end
local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
enemy.Cash = enemy.Cash - building.cost

View File

@@ -20,12 +20,6 @@ BaseApwr2 = { type = "apwr", pos = CVec.New(6, -5), cost = 500, exists = true }
BaseBuildings = { BaseApwr, BaseTent, BaseProc, BaseWeap, BaseApwr2 }
BuildBase = function()
if CYard.IsDead or CYard.Owner ~= enemy then
return
elseif Harvester.IsDead and enemy.Resources <= 299 then
return
end
for i,v in ipairs(BaseBuildings) do
if not v.exists then
BuildBuilding(v)
@@ -38,6 +32,12 @@ end
BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
if CYard.IsDead or CYard.Owner ~= enemy then
return
elseif Harvester.IsDead and enemy.Resources <= 299 then
return
end
local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
enemy.Cash = enemy.Cash - building.cost