mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Merge pull request 'Fix crash when unknown item in offhand slot' (#2265) from fix-unknown-offhand into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2265 Reviewed-by: NO11 <no11@noreply.git.minetest.land>
This commit is contained in:
commit
b27634fcb2
1 changed files with 3 additions and 2 deletions
|
@ -59,8 +59,9 @@ minetest.register_globalstep(function(dtime)
|
||||||
local itemstack = mcl_offhand.get_offhand(player)
|
local itemstack = mcl_offhand.get_offhand(player)
|
||||||
local offhand_item = itemstack:get_name()
|
local offhand_item = itemstack:get_name()
|
||||||
local offhand_hud = mcl_offhand[player].hud
|
local offhand_hud = mcl_offhand[player].hud
|
||||||
if offhand_item ~= "" then
|
local item = minetest.registered_items[offhand_item]
|
||||||
local item_texture = minetest.registered_items[offhand_item].inventory_image .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px
|
if offhand_item ~= "" and item then
|
||||||
|
local item_texture = item.inventory_image .. "^[resize:" .. max_offhand_px .. "x" .. max_offhand_px
|
||||||
local position = {x = 0.5, y = 1}
|
local position = {x = 0.5, y = 1}
|
||||||
local offset = {x = -320, y = -32}
|
local offset = {x = -320, y = -32}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue