diff --git a/utilities/definitions/paperclips.lua b/utilities/definitions/paperclips.lua index efd0f114..ac175e15 100644 --- a/utilities/definitions/paperclips.lua +++ b/utilities/definitions/paperclips.lua @@ -16,6 +16,7 @@ PB_UTIL.ENABLED_PAPERCLIPS = { if PB_UTIL.config.paperclips_enabled then -- Table to hold all paperclip keys regardless of mod of origin for easy reference PB_UTIL.Paperclips = {} + PB_UTIL.Paperclips_keys = {} PB_UTIL.Paperclip = SMODS.Sticker:extend { prefix_config = { key = true }, @@ -31,6 +32,7 @@ if PB_UTIL.config.paperclips_enabled then inject = function(self, i) SMODS.Sticker.inject(self, i) + PB_UTIL.Paperclips_keys[self.key] = true table.insert(PB_UTIL.Paperclips, self.key) end, diff --git a/utilities/misc_functions.lua b/utilities/misc_functions.lua index 4bd26a0c..66fa4c97 100644 --- a/utilities/misc_functions.lua +++ b/utilities/misc_functions.lua @@ -43,12 +43,7 @@ end ---@param str string ---@return boolean function PB_UTIL.is_paperclip(str) - for _, v in ipairs(PB_UTIL.Paperclips or {}) do - if v == str then - return true - end - end - return false + return PB_UTIL.Paperclips_keys[str] == true end ---Checks if a card has a paperclip. If found, the first value returned is the key.