From bab8517b2a07e41ea3b9122cb9d93d10bba3e430 Mon Sep 17 00:00:00 2001
From: ShadowNinja <shadowninja@minetest.net>
Date: Tue, 17 Dec 2013 20:22:10 +0100
Subject: [PATCH] Add protection support to tools

---
 technic/tools/chainsaw.lua |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/technic/tools/chainsaw.lua b/technic/tools/chainsaw.lua
index fd8ce2c..4124265 100644
--- a/technic/tools/chainsaw.lua
+++ b/technic/tools/chainsaw.lua
@@ -203,6 +203,10 @@
 
 -- Saw down trees entry point
 local function chainsaw_dig_it(pos, player,current_charge)
+	if minetest.is_protected(pos, player:get_player_name()) then
+		minetest.record_protection_violation(pos, player:get_player_name())
+		return current_charge
+	end
         local remaining_charge=current_charge
 
         -- Save the currently installed dropping mechanism so we can restore it.

--
Gitblit v1.8.0