From 509306f2cc347023767bb3e02af8724dba18deb1 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Fri, 20 Jan 2023 17:11:54 -0500 Subject: [PATCH] Fix Hold Map Desc not working if maxdescs=1 --- main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 388e54ad..b881d4b0 100644 --- a/main.lua +++ b/main.lua @@ -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