Skip to content

Commit

Permalink
Fix PBM grabbing Mobile Factories (FAForever#5412)
Browse files Browse the repository at this point in the history
The new mobile factory units' external factory component gets picked up by the campaign AI's PBM, because they are categorized as structures, this commit fixes that by excluding the proper category when the AI is picking the factories to assign.
  • Loading branch information
Dhomie authored Sep 10, 2023
1 parent 488802f commit 6013c26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/aibrains/campaign-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ AIBrain = Class(StandardBrain) {
local seaFactories = {}
local gates = {}
for ek, ev in factories do
if EntityCategoryContains(categories.FACTORY * categories.AIR, ev) and self:PBMFactoryLocationCheck(ev, v) then
if EntityCategoryContains(categories.FACTORY * categories.AIR - categories.EXTERNALFACTORYUNIT, ev) and self:PBMFactoryLocationCheck(ev, v) then
table.insert(airFactories, ev)
elseif EntityCategoryContains(categories.FACTORY * categories.LAND, ev) and self:PBMFactoryLocationCheck(ev, v) then
elseif EntityCategoryContains(categories.FACTORY * categories.LAND - categories.EXTERNALFACTORYUNIT, ev) and self:PBMFactoryLocationCheck(ev, v) then
table.insert(landFactories, ev)
elseif EntityCategoryContains(categories.FACTORY * categories.NAVAL, ev) and self:PBMFactoryLocationCheck(ev, v) then
elseif EntityCategoryContains(categories.FACTORY * categories.NAVAL - categories.EXTERNALFACTORYUNIT, ev) and self:PBMFactoryLocationCheck(ev, v) then
table.insert(seaFactories, ev)
elseif EntityCategoryContains(categories.FACTORY * categories.GATE, ev) and self:PBMFactoryLocationCheck(ev, v) then
elseif EntityCategoryContains(categories.FACTORY * categories.GATE - categories.EXTERNALFACTORYUNIT, ev) and self:PBMFactoryLocationCheck(ev, v) then
table.insert(gates, ev)
end
end
Expand Down

0 comments on commit 6013c26

Please sign in to comment.