Fix Hold Map Desc not working if maxdescs=1

This commit is contained in:
Buurazu authored and GitHub committed 2023-01-20 17:11:54 -05:00
1 parent 131605c3e2
commit 509306f2cc
1 file changed
+3 -1
+3 -1
View File
@@ -457,9 +457,11 @@ end
function EID:addDescriptionToPrint(desc, insertLoc)
if desc.Entity and EID.entitiesToPrint[GetPtrHash(desc.Entity)] then return end
if #EID.descriptionsToPrint == EID.Config["MaxDescriptionsToDisplay"] then return end
if #EID.descriptionsToPrint == EID.Config["MaxDescriptionsToDisplay"] and not insertLoc then return end
if insertLoc then table.insert(EID.descriptionsToPrint, insertLoc, desc)
else table.insert(EID.descriptionsToPrint, desc) end
-- if we've inserted a desc at the front of a full desc list, pop the last desc out of the table
if #EID.descriptionsToPrint > EID.Config["MaxDescriptionsToDisplay"] then table.remove(EID.descriptionsToPrint) end
if desc.Entity then EID.entitiesToPrint[GetPtrHash(desc.Entity)] = true end
end