summaryrefslogtreecommitdiff
path: root/gamemode/client
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/client')
-rw-r--r--gamemode/client/cl_inventory.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua
index 1e69ec7..5c394e6 100644
--- a/gamemode/client/cl_inventory.lua
+++ b/gamemode/client/cl_inventory.lua
@@ -409,8 +409,17 @@ function PANEL:Init()
// for some reason has stone twice? v
for j,k in SortedPairs(v.Results) do
if (j != "Stone") then
- icon = GMS.GetResourceByName(j).Icon
- if (icon != nil && icon != "test.png") then img:SetImage(icon) else img:SetImage("vgui/avatar_default") end
+ if(GMS.Resources[j] == nil) then --This resource is not registered!
+ img:SetImage("vgui/avatar_default")
+ print("Resource:" .. j .. " not registed! This might be a bug!")
+ continue
+ elseif(GMS.Resources[j].Icon == nil) then
+ img:SetImage("vgui/avatar_default")
+ print("Resource:" .. j .. " does not have an .Icon field! This might be a bug!")
+ continue
+ else
+ img:SetImage(GMS.Resources[j].Icon)
+ end
end
end