Fix server crash when dispensing an unknown item
This works similar to 2aafb2f2d01a6ece9ed4642a7081c53dbf22f773, however it is a cleaner way to do it.chat-command-builder-2^2
parent
8445a9ddec
commit
fb01e61946
|
@ -129,8 +129,13 @@ local dispenserdef = {
|
|||
dropitem:set_count(1)
|
||||
local stack_id = stacks[r].stackpos
|
||||
local stackdef = stack:get_definition()
|
||||
|
||||
if not stackdef then
|
||||
return
|
||||
end
|
||||
|
||||
local iname = stack:get_name()
|
||||
local igroups = minetest.registered_items[iname].groups
|
||||
local igroups = stackdef.groups
|
||||
|
||||
--[===[ Dispense item ]===]
|
||||
|
||||
|
|
Loading…
Reference in New Issue