diff options
Diffstat (limited to 'gamemode/client')
| -rw-r--r-- | gamemode/client/cl_inventory.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 73df961..c779384 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -413,8 +413,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 |
