Skip to content

Commit

Permalink
Help out players using chat reserves
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Dec 10, 2023
1 parent 0b86f56 commit ff33a22
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1656,21 +1656,21 @@ function LootReserve.Server:PrepareSession()
whitelist[matches[1]] = true;
end
elseif #matches > 1 then
local names = { };
local links = { };
for _, itemID in ipairs(matches) do
local item = LootReserve.ItemCache:Item(itemID);
if item and item:GetInfo() then
table.insert(names, item:GetName());
table.insert(links, item:GetLink());
end
if #matches >= 5 then
if #links >= 2 then
break;
end
end
LootReserve:SendChatMessage(format("Try being more specific, %d items match that name%s%s%s",
LootReserve:SendChatMessage(format("Be more specific, or link the item. %d matching items%s%s%s",
#matches,
#names > 0 and ": " or "",
strjoin(", ", unpack(names)),
#names > 0 and #matches > #names and format(" and %d more...", #matches - #names) or ""
#links > 0 and ": " or "",
strjoin(", ", unpack(links)),
#links > 0 and #matches > #links and format(" and %d more...", #matches - #links) or ""
), "WHISPER", sender);
self:SendSupportString(sender, true);
end
Expand Down

0 comments on commit ff33a22

Please sign in to comment.