Fix the harvest protection logic
This commit is contained in:
@@ -30,7 +30,7 @@ SmugglerVehicleTypes = { "raider", "raider", "quad" }
|
||||
SmugglerTankType = { "combat_tank_o" }
|
||||
|
||||
InitAIUnits = function(house)
|
||||
HarvesterKilled[house] = true
|
||||
LastHarvesterEaten[house] = true
|
||||
IdlingUnits[house] = Reinforcements.Reinforce(house, InitialReinforcements[house.Name], InitialReinforcementsPaths[house.Name])
|
||||
|
||||
DefendAndRepairBase(house, Base[house.Name], 0.75, AttackGroupSize[Difficulty])
|
||||
|
||||
@@ -71,11 +71,11 @@ Hunt = function(house)
|
||||
end
|
||||
|
||||
CheckHarvester = function(house)
|
||||
if DateTime.GameTime % DateTime.Seconds(30) and HarvesterKilled[house] then
|
||||
if DateTime.GameTime % DateTime.Seconds(30) and LastHarvesterEaten[house] then
|
||||
local units = house.GetActorsByType("harvester")
|
||||
|
||||
if #units > 0 then
|
||||
HarvesterKilled[house] = false
|
||||
LastHarvesterEaten[house] = false
|
||||
ProtectHarvester(units[1], house, AttackGroupSize[Difficulty])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user