Skip to content

Commit

Permalink
Fix campaign objectives not being completable by AI players (#6369)
Browse files Browse the repository at this point in the history
  • Loading branch information
maudlin27 authored Nov 7, 2024
1 parent 5302a1b commit 3cc1ec6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/snippets/fix.6369.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6369) AI player teammates should now be able to complete campaign objectives such as the opening Supcom mission's objective to build 3 mexes.
3 changes: 2 additions & 1 deletion lua/SimObjectives.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,8 @@ function MakeListFromTarget(Target)
for _, armyName in Target.Armies do
if armyName == "HumanPlayers" then
for iArmy, strArmy in pairs(tblArmy) do
if ScenarioInfo.ArmySetup[strArmy].Human then
--In campaign, if an AI mod is being used to provide an AI 'player', then this should also be included otherwise it can render some missions impossible to complete
if ScenarioInfo.ArmySetup[strArmy].Human or (ScenarioInfo.type == 'campaign_coop' and string.sub(strArmy, 1, 6) == 'Player') then
resultList[GetArmyBrain(iArmy)] = true
end
end
Expand Down

0 comments on commit 3cc1ec6

Please sign in to comment.