forked from Mineclonia/Mineclonia
Fix server crash when dispensing an unknown item
This commit is contained in:
parent
86c1f37296
commit
2aafb2f2d0
|
@ -129,6 +129,19 @@ local dispenserdef = {
|
||||||
local stack_id = stacks[r].stackpos
|
local stack_id = stacks[r].stackpos
|
||||||
local stackdef = stack:get_definition()
|
local stackdef = stack:get_definition()
|
||||||
local iname = stack:get_name()
|
local iname = stack:get_name()
|
||||||
|
if not minetest.registered_items[iname] then
|
||||||
|
minetest.log(
|
||||||
|
"warning",
|
||||||
|
"Trying to dispense unknown item " ..
|
||||||
|
"“" .. iname .. "” " ..
|
||||||
|
"near (" ..
|
||||||
|
pos.x .. ", " ..
|
||||||
|
pos.y .. ", " ..
|
||||||
|
pos.z ..
|
||||||
|
")"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
end
|
||||||
local igroups = minetest.registered_items[iname].groups
|
local igroups = minetest.registered_items[iname].groups
|
||||||
|
|
||||||
--[===[ Dispense item ]===]
|
--[===[ Dispense item ]===]
|
||||||
|
|
Loading…
Reference in New Issue