Fix crash if wielditem inventory image is nil

This commit is contained in:
stujones11 2014-06-25 21:10:35 +01:00
parent 6f7a0ea7fc
commit 7eebc378a6

@ -21,8 +21,9 @@ wieldview.get_item_texture = function(self, item)
local texture = "3d_armor_trans.png"
if item ~= "" then
if minetest.registered_items[item] then
if minetest.registered_items[item].inventory_image ~= "" then
texture = minetest.registered_items[item].inventory_image
local inventory_image = minetest.registered_items[item].inventory_image
if inventory_image and inventory_image ~= "" then
texture = inventory_image
elseif node_tiles == true and minetest.registered_items[item].tiles then
texture = minetest.registered_items[item].tiles[1]
end