aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-12-27 22:21:22 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-12-27 22:21:22 +0100
commit2b018d490ecdb60a19073525398dece8663409ac (patch)
tree31c98ad6037aeae6c361110a63cf82c8e0569030
parent7a9af47fe25fadb59ace8875ed9f138cbad13236 (diff)
downloadfireworkz-2b018d490ecdb60a19073525398dece8663409ac.tar.gz
fireworkz-2b018d490ecdb60a19073525398dece8663409ac.tar.bz2
fireworkz-2b018d490ecdb60a19073525398dece8663409ac.zip
Fix infinite usage of fireworks.
-rw-r--r--init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index bda971d..9b14c92 100644
--- a/init.lua
+++ b/init.lua
@@ -268,8 +268,10 @@ for _, i in pairs(variant_list) do
on_use = function(itemstack, user, pointed_thing)
local pos = minetest.get_pointed_thing_position(pointed_thing, true)
if pos then
- fireworkz.launch(pos, rdt)
+ itemstack:take_item()
+ fireworkz.launch(pos, rdt)
end
+ return itemstack
end,
on_construct = function(pos)