mirror of
https://gitlab.icynet.eu/evert/fluid_lib.git
synced 2024-12-18 11:15:43 +01:00
Fix insertion returns, fix error on invalid stack index
This commit is contained in:
parent
9db0dc184c
commit
a1cbc91029
@ -87,8 +87,8 @@ end
|
||||
|
||||
function fluid_lib.insert_into_buffer(pos, buffer, fluid, count)
|
||||
local bfdata = fluid_lib.get_buffer_data(pos, buffer)
|
||||
if not bfdata then return 0 end
|
||||
if bfdata.fluid ~= fluid and bfdata.fluid ~= "" then return 0 end
|
||||
if not bfdata then return count end
|
||||
if bfdata.fluid ~= fluid and bfdata.fluid ~= "" then return count end
|
||||
|
||||
local can_put = fluid_lib.can_insert_into_buffer(pos, buffer, fluid, count)
|
||||
|
||||
|
@ -75,6 +75,7 @@ local nodeiodef = {
|
||||
for buf in pairs(bfs) do
|
||||
cnt[#cnt + 1] = buf
|
||||
end
|
||||
if not cnt[index] then return ItemStack(nil) end
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
return meta:get_string(cnt[index] .. "_fluid")
|
||||
@ -86,6 +87,7 @@ local nodeiodef = {
|
||||
for buf in pairs(bfs) do
|
||||
cnt[#cnt + 1] = buf
|
||||
end
|
||||
if not cnt[index] then return ItemStack(nil) end
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
return ItemStack(meta:get_string(cnt[index] .. "_fluid") .. " " ..
|
||||
|
Loading…
Reference in New Issue
Block a user