From 30daafae2e682effaa21e87b113d93a10879d311 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 21 Jun 2012 09:41:16 +0000 Subject: Core: Added the check for item damage before attempting a repair git-svn-id: http://mc-server.googlecode.com/svn/trunk@636 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- Plugins/Core/oncraftingnorecipe.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Plugins/Core/oncraftingnorecipe.lua') diff --git a/Plugins/Core/oncraftingnorecipe.lua b/Plugins/Core/oncraftingnorecipe.lua index 78f2cf65a..2006e410f 100644 --- a/Plugins/Core/oncraftingnorecipe.lua +++ b/Plugins/Core/oncraftingnorecipe.lua @@ -3,7 +3,7 @@ -- Based on Fixies plugin v2 by Taugeshtu --- how much "extra" points are healed per a repair operation (fraction) +-- how much "extra" points are healed per a repair operation (fraction of full health) BONUS = 0.1 @@ -28,7 +28,16 @@ function OnCraftingNoRecipe(Player, Grid, Recipe) end if (Items[1].m_ItemID ~= Items[2].m_ItemID) then - -- Only same items may be fixed + -- Only items of the same type may be fixed + return false + end + + if ( + (Items[1].m_ItemHealth == 0) or + (Items[2].m_ItemHealth == 0) + ) + then + -- Only damaged items may be fixed return false end -- cgit v1.2.3