Skip to content

Commit

Permalink
refactor(server/items): remove error on invalid item
Browse files Browse the repository at this point in the history
This'll just confuse 99% of users.
  • Loading branch information
thelindat committed Sep 5, 2022
1 parent a597c56 commit 3621e71
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions modules/items/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local trash = {

---@param internal table?
---@param name string?
---@return table
---@return table?
local function getItem(internal, name)
if name then
name = name:lower()
Expand All @@ -46,13 +46,7 @@ local function getItem(internal, name)
name = name:upper()
end

local item = ItemList[name]

if internal and not item then
error(("attempted to fetch data for invalid item '%s'"):format(name))
end

return item
return ItemList[name]
end

return ItemList
Expand Down

0 comments on commit 3621e71

Please sign in to comment.