Skip to content

Commit

Permalink
Fix GetArmyBrain being called on observers in sim side of recall (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored Nov 21, 2024
1 parent 953a4ad commit 32ae70b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/snippets/fix.6396.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6396, #6538) Fix recall failing on 1 "no" vote less than needed, dead players having their previous recall votes still in effect, and multiple bugs with the voting UI (mainly previous votes showing up again for new recalls).
7 changes: 6 additions & 1 deletion lua/sim/Recall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ end
---@return CannotRecallReason
---@return number? cooldown no timeout/cooldown if absent
function ArmyRecallRequestCooldown(army)
if army == -1 then
return "observer"
end

local brain = GetArmyBrain(army)
if army == -1 or brain:IsDefeated() then

if brain:IsDefeated() then
return "observer"
end
if ScenarioInfo.RecallDisabled then
Expand Down

0 comments on commit 32ae70b

Please sign in to comment.