forked from Mineclonia/Mineclonia
Merge pull request 'ITEMS/REDSTONE/mcl_dispensers: Fix server crash when dispensing an unknown item' (#93) from fix-dispenser-unknown-item-crash into master
Reviewed-on: Mineclonia/Mineclonia#93 Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
commit
c9a8ef0ac2
|
@ -129,6 +129,19 @@ local dispenserdef = {
|
|||
local stack_id = stacks[r].stackpos
|
||||
local stackdef = stack:get_definition()
|
||||
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
|
||||
|
||||
--[===[ Dispense item ]===]
|
||||
|
|
Loading…
Reference in New Issue