Skip to content

Commit

Permalink
Fix reclaim labels
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNukealizer authored and aeoncleanse committed Nov 27, 2017
1 parent 7d96a48 commit 58596d2
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions lua/ui/game/reclaim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,29 +180,28 @@ function UpdateLabels()
if labelIndex > MaxLabels then
break
end
if not LabelPool[labelIndex] then
LabelPool[labelIndex] = CreateReclaimLabel(view.ReclaimGroup, r)
else
if IsDestroyed(r) then
LabelPool[labelIndex] = nil
continue
end
local label = LabelPool[labelIndex]
if label and IsDestroyed(label) then
label = nil
end
if not label then
label = CreateReclaimLabel(view.ReclaimGroup, r)
LabelPool[labelIndex] = label
end

local label = LabelPool[labelIndex]
label:DisplayReclaim(r)
labelIndex = labelIndex + 1
end

-- Hide labels we didn't use
for index = labelIndex, MaxLabels do
if IsDestroyed(LabelPool[index]) then
LabelPool[index] = nil
continue
end
local label = LabelPool[index]
if label and not label:IsHidden() then
label:Hide()
if label then
if IsDestroyed(label) then
LabelPool[index] = nil
elseif not label:IsHidden() then
label:Hide()
end
end
end
end
Expand Down

0 comments on commit 58596d2

Please sign in to comment.