1
0

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
This commit is contained in:
madmaxoft@gmail.com 2012-06-21 09:41:16 +00:00
parent 47f963ba72
commit 30daafae2e

View File

@ -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