Skip to content

Commit

Permalink
lua: remove hardcoded key names from result of edicts.isdoor() func…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
alexey-lysiuk committed Nov 5, 2023
1 parent f0557a4 commit 592cc0e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Misc/qs_pak/scripts/edicts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,15 @@ local function getitemname(item)
end

for _, edict in ipairs(edicts) do
if edict.items == item and edict.classname:find('item_') == 1 then
if not isfree(edict) and edict.items == item and edict.classname:find('item_') == 1 then
local name = edict.netname

if not name or name == '' then
if item == itemflags.IT_KEY1 then
return 'Silver Key'
elseif item == itemflags.IT_KEY2 then
return 'Gold Key'
end
if name and name ~= '' then
return titlecase(name)
end

return titlecase(name)
name = itemnames[item]
return name or '???'
end
end

Expand Down

0 comments on commit 592cc0e

Please sign in to comment.