Skip to content

Commit

Permalink
Fix runtime errors/intellisense warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 committed Dec 26, 2024
1 parent 028e2e9 commit 59c3ae2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/SimUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,12 @@ function KillArmyOnDelayedRecall(self, shareOption, shareTime)
-- Share units including ACUs and walls and keep track of ACUs
local brainCategories = GetAllegianceCategories(self:GetArmyIndex())
local newUnits = TransferUnitsToHighestBrain(self, brainCategories.Allies, true, categories.ALLUNITS, "DisconnectShareTemporary")
local sharedCommanders = EntityCategoryFilterDown(categories.COMMAND, newUnits)
local sharedCommanders = EntityCategoryFilterDown(categories.COMMAND, newUnits or {})

-- non-assassination games could have an army abandon without having any commanders
if not table.empty(sharedCommanders) then
-- create a countdown to show when the ACU recalls (similar to the one used for timed self-destruct)
for _, com in sharedCommanders do
for i, com in sharedCommanders do
-- don't recall shared ACUs
if com.RecallingAfterDefeat then
sharedCommanders[i] = nil
Expand Down Expand Up @@ -994,7 +994,7 @@ function KillArmyOnACUDeath(self, shareOption)
-- Share units including ACUs and walls and keep track of ACUs
local brainCategories = GetAllegianceCategories(self:GetArmyIndex())
local newUnits = TransferUnitsToHighestBrain(self, brainCategories.Allies, true, categories.ALLUNITS, "DisconnectSharePermanent")
local sharedCommanders = EntityCategoryFilterDown(categories.COMMAND, newUnits)
local sharedCommanders = EntityCategoryFilterDown(categories.COMMAND, newUnits or {})

if not table.empty(sharedCommanders) then
local shareTick = GetGameTick()
Expand All @@ -1013,7 +1013,7 @@ function KillArmyOnACUDeath(self, shareOption)

-- if all the commanders die early, assume disconnect abuse and apply standard share condition. Only makes sense in Assassination.
local scenarioOptions = ScenarioInfo.Options
if not oneComAlive and shareTime + CommanderSafeTime <= GetGameTick() and scenarioOptions.Victory == "demoralization" then
if not oneComAlive and shareTick + CommanderSafeTime <= GetGameTick() and scenarioOptions.Victory == "demoralization" then
KillArmy(self, scenarioOptions.Share)
return
end
Expand Down

0 comments on commit 59c3ae2

Please sign in to comment.