diff --git a/changelog.txt b/changelog.txt index 3d8a716..1a2d27a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -10,6 +10,7 @@ Version: 3.3.0 - Fixed squad command timeout duration to account for 4 chunk pathing finding - Fixed death pheromone could zero out a chunk for squad movement planning - Fixed squad creation didn't take into account chunk pathing from nest to squad + - Fixed chunk being invalid on unit group finished gathering --------------------------------------------------------------------------------------------------- Version: 3.2.2 diff --git a/control.lua b/control.lua index 56bee1e..02d414e 100644 --- a/control.lua +++ b/control.lua @@ -750,14 +750,15 @@ local function onUnitGroupCreated(event) (Universe.builderCount < Universe.AI_MAX_VANILLA_BUILDER_COUNT) and (Universe.random() < 0.25) - if not settler and ( (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) or (chunk == -1) ) then - group.destroy() - return - end - if not settler and (chunk[BASE_PHEROMONE] < 0.0001) and (chunk[PLAYER_PHEROMONE] < 0.0001) then - group.destroy() - return + if not settler then + if (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) + or (chunk == -1) + or ((chunk[BASE_PHEROMONE] < 0.0001) and (chunk[PLAYER_PHEROMONE] < 0.0001)) + then + group.destroy() + return + end end squad = createSquad(nil, map, group, settler, base) @@ -778,14 +779,14 @@ local function onUnitGroupCreated(event) (Universe.builderCount < Universe.AI_MAX_VANILLA_BUILDER_COUNT) and (Universe.random() < 0.25) - if not settler and ( (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) or (chunk == -1) ) then - group.destroy() - return - end - - if not settler and chunk[BASE_PHEROMONE] < 0.0001 and chunk[PLAYER_PHEROMONE] < 0.0001 then - group.destroy() - return + if not settler then + if (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) + or (chunk == -1) + or ((chunk[BASE_PHEROMONE] < 0.0001) and (chunk[PLAYER_PHEROMONE] < 0.0001)) + then + group.destroy() + return + end end squad = createSquad(nil, map, group, settler, base) @@ -851,14 +852,14 @@ local function onGroupFinishedGathering(event) (Universe.builderCount < Universe.AI_MAX_VANILLA_BUILDER_COUNT) and (Universe.random() < 0.25) - if not settler and (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) then - group.destroy() - return - end - - if not settler and (chunk[BASE_PHEROMONE] < 0.0001) and (chunk[PLAYER_PHEROMONE] < 0.0001) then - group.destroy() - return + if not settler then + if (Universe.squadCount >= Universe.AI_MAX_VANILLA_SQUAD_COUNT) + or (chunk == -1) + or ((chunk[BASE_PHEROMONE] < 0.0001) and (chunk[PLAYER_PHEROMONE] < 0.0001)) + then + group.destroy() + return + end end squad = createSquad(nil, map, group, settler, base)