From 779baaf3de105a609213c87ce3399371e651204c Mon Sep 17 00:00:00 2001
From: Calinou <calinou@opmbx.org>
Date: Sat, 5 Jul 2014 10:57:50 +0200
Subject: Tool damage fix.

---
 init.lua | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/init.lua b/init.lua
index 857fbb8..7585d7d 100644
--- a/init.lua
+++ b/init.lua
@@ -174,25 +174,28 @@ local function add_ore(modname, description, mineral_name, oredef)
 				groupcaps = tooldef
 			}
 		}
-
+		
 		if toolname == "sword" then
-			tdef.full_punch_interval = oredef.full_punch_interval
-			tdef.damage_groups = oredef.damage_groups
+			tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.damage_groups = oredef.damage_groups
 			tdef.description = S("%s Sword"):format(S(description))
 		end
-
+	
 		if toolname == "pick" then
-			tdef.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.damage_groups = oredef.damage_groups
 			tdef.description = S("%s Pickaxe"):format(S(description))
 		end
-		
+		  
 		if toolname == "axe" then
-			tdef.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.damage_groups = oredef.damage_groups
 			tdef.description = S("%s Axe"):format(S(description))
 		end
 
 		if toolname == "shovel" then
 			tdef.full_punch_interval = oredef.full_punch_interval
+			tdef.tool_capabilities.damage_groups = oredef.damage_groups
 			tdef.description = S("%s Shovel"):format(S(description))
 		end
 		
-- 
cgit v1.2.3