From fc7a23f8b16334fae1a3bfc9cc9470e72e5a454c Mon Sep 17 00:00:00 2001
From: kpoppel <poulsen.kim@gmail.com>
Date: Wed, 12 Jun 2013 22:12:13 +0200
Subject: [PATCH] Merge pull request #26 from kpoppel/master

---
 technic/chainsaw.lua |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/technic/chainsaw.lua b/technic/chainsaw.lua
index c31d9a8..5b3b05b 100644
--- a/technic/chainsaw.lua
+++ b/technic/chainsaw.lua
@@ -138,12 +138,22 @@
         timber_nodenames["growing_cactus:branch_xx"]                    = true
 end
 
+-- Support farming_plus if it is there
+if( minetest.get_modpath("farming_plus") ~= nil ) then
+   if chainsaw_leaves == true then
+      timber_nodenames["farming_plus:cocoa_leaves"] = true
+   end
+end
+
 -- Table for saving what was sawed down
 local produced
 
 -- Saw down trees entry point
 chainsaw_dig_it = function(pos, player,current_charge)
         local remaining_charge=current_charge
+
+        -- Save the currently installed dropping mechanism so we can restore it.
+	local original_handle_node_drops = minetest.handle_node_drops
 
         -- A bit of trickery here: use a different node drop callback
         -- and restore the original afterwards.
@@ -194,9 +204,6 @@
                 end
         end
 end
-
--- Save the currently installed dropping mechanism so we can restore it.
-local original_handle_node_drops = minetest.handle_node_drops
 
 -- This function does all the hard work. Recursively we dig the node at hand
 -- if it is in the table and then search the surroundings for more stuff to dig.

--
Gitblit v1.8.0