added failsafe in compass if an item doesn't exist
This commit is contained in:
parent
0f3f04f4f1
commit
96130c3407
@ -119,11 +119,13 @@ function step(dtime)
|
|||||||
local itemstack = inv:get_stack("main", i)
|
local itemstack = inv:get_stack("main", i)
|
||||||
local item = minetest.registered_items[itemstack:get_name()]
|
local item = minetest.registered_items[itemstack:get_name()]
|
||||||
|
|
||||||
|
if item ~= nil then
|
||||||
if item.groups.nav_compass then
|
if item.groups.nav_compass then
|
||||||
inv:set_stack("main", i, ItemStack("nav:compass_"..dir))
|
inv:set_stack("main", i, ItemStack("nav:compass_"..dir))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_globalstep(step)
|
minetest.register_globalstep(step)
|
Loading…
Reference in New Issue
Block a user