1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-30 13:50:23 +02:00

Fix set_node(air) calls

In the fireflies case it can be replaced with remove_node.
In the beds case we fix the logic to do what it should. Coincidentally the end result was correct nonetheless.
This commit is contained in:
sfan5
2024-04-13 13:32:18 +02:00
parent 0639681f9b
commit 31133a371e
2 changed files with 12 additions and 7 deletions

View File

@ -104,7 +104,7 @@ minetest.register_tool("fireflies:bug_net", {
local node_name = minetest.get_node(pointed_thing.under).name
local inv = player:get_inventory()
if minetest.get_item_group(node_name, "catchable") == 1 then
minetest.set_node(pointed_thing.under, {name = "air"})
minetest.remove_node(pointed_thing.under)
local stack = ItemStack(node_name.." 1")
local leftover = inv:add_item("main", stack)
if leftover:get_count() > 0 then