summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorh-v-smacker <hans-von-smacker+github@gmail.com>2018-05-12 15:09:24 +0300
committerh-v-smacker <hans-von-smacker+github@gmail.com>2018-05-12 15:09:24 +0300
commitb0484272fe934aff2141f3c46b9f22a73336ae64 (patch)
tree327095b718d2e65c36a16fb9a5e56d8b8faf1bbd
parentb72c312924f5b4f2dd7ccca9c71d0d7c56eed2e1 (diff)
nodebreaker+trimmer bug fix
-rw-r--r--technic/tools/lawn_trimmer.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/technic/tools/lawn_trimmer.lua b/technic/tools/lawn_trimmer.lua
index 1be0d52..6ba1427 100644
--- a/technic/tools/lawn_trimmer.lua
+++ b/technic/tools/lawn_trimmer.lua
@@ -65,7 +65,7 @@ end
-- Perform the trimming action
-local function trim_the_lawn(itemstack, user)
+local function trim_the_lawn(itemstack, user, pointed_thing)
local meta = minetest.deserialize(itemstack:get_metadata())
local keys = user:get_player_control()
@@ -79,7 +79,13 @@ local function trim_the_lawn(itemstack, user)
return -- no charge for even a single node, aborting
end
- local pos = user:get_pos()
+ local pos
+ if user.get_pos ~= nil then
+ pos = user:get_pos()
+ else
+ -- we are held in a node breaker
+ pos = pointed_thing.under
+ end
minetest.sound_play("technic_lawn_trimmer", {
-- to_player = user:get_player_name(),