fixed a bug that would crash the game if player tried to take liquid out of an empty silo or barrel.

This commit is contained in:
NathanSalapat 2019-09-01 19:51:28 -05:00
parent 631d641249
commit 66c1ce1be5

View File

@ -478,6 +478,9 @@ minetest.register_node('drinks:liquid_barrel', {
return 0
end
elseif listname == 'dst' then --removing liquid
--make sure there is a liquid to remove
local juice = meta:get_string('fruit')
if juice ~= 'empty' then
local inputstack = stack:get_name()
local inputcount = stack:get_count()
local valid = string.sub(inputstack, 1, 7)
@ -486,6 +489,9 @@ minetest.register_node('drinks:liquid_barrel', {
else
return 0
end
else
return 0
end
end
end,
})
@ -589,6 +595,9 @@ minetest.register_node('drinks:liquid_silo', {
return 0
end
elseif listname == 'dst' then --removing liquid
--make sure there is liquid to take_item
local juice = meta:get_string('fruit')
if juice ~= 'empty' then
local inputstack = stack:get_name()
local inputcount = stack:get_count()
local valid = string.sub(inputstack, 1, 7)
@ -597,6 +606,9 @@ minetest.register_node('drinks:liquid_silo', {
else
return 0
end
else
return 0
end
end
end,
})