Skip to content

Commit d2eacc3

Browse files
committed
Fix unit dead check
UI doesn't have .Dead There's an error spam when selected ACU or Nuke is killed / deleted, which triggers cinematics
1 parent 7b0ae76 commit d2eacc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/ui/game/orders.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ local function disPauseFunc()
891891
end
892892

893893
local function NukeBtnText(button)
894-
if not currentSelection[1] or currentSelection[1].Dead then return '' end
894+
if not currentSelection[1] or IsDestroyed(currentSelection[1]) then return '' end
895895
if table.getsize(currentSelection) > 1 then
896896
button.buttonText:SetColor('fffff600')
897897
return '?'
@@ -907,7 +907,7 @@ local function NukeBtnText(button)
907907
end
908908

909909
local function TacticalBtnText(button)
910-
if not currentSelection[1] or currentSelection[1].Dead then return '' end
910+
if not currentSelection[1] or IsDestroyed(currentSelection[1]) then return '' end
911911
if table.getsize(currentSelection) > 1 then
912912
button.buttonText:SetColor('fffff600')
913913
return '?'
@@ -999,7 +999,7 @@ end
999999

10001000
function EnterOverchargeMode()
10011001
local unit = currentSelection[1]
1002-
if not unit or unit.Dead or unit:IsOverchargePaused() then return end
1002+
if not unit or IsDestroyed(unit) or unit:IsOverchargePaused() then return end
10031003
local bp = unit:GetBlueprint()
10041004
local weapon = FindOCWeapon(unit:GetBlueprint())
10051005
if not weapon then return end
@@ -1012,7 +1012,7 @@ end
10121012

10131013
local function OverchargeFrame(self, deltaTime)
10141014
local unit = currentSelection[1]
1015-
if not unit or unit.Dead then return end
1015+
if not unit or IsDestroyed(unit) then return end
10161016
local weapon = FindOCWeapon(unit:GetBlueprint())
10171017
if not weapon then
10181018
self:SetNeedsFrameUpdate(false)

0 commit comments

Comments
 (0)