summaryrefslogtreecommitdiffstats
path: root/Plugins
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-21 11:41:16 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-21 11:41:16 +0200
commit30daafae2e682effaa21e87b113d93a10879d311 (patch)
treec67de522baa4895f7910a612a5f4c718ab14f4c9 /Plugins
parentCore: merged in the Fixies plugin code (diff)
downloadcuberite-30daafae2e682effaa21e87b113d93a10879d311.tar
cuberite-30daafae2e682effaa21e87b113d93a10879d311.tar.gz
cuberite-30daafae2e682effaa21e87b113d93a10879d311.tar.bz2
cuberite-30daafae2e682effaa21e87b113d93a10879d311.tar.lz
cuberite-30daafae2e682effaa21e87b113d93a10879d311.tar.xz
cuberite-30daafae2e682effaa21e87b113d93a10879d311.tar.zst
cuberite-30daafae2e682effaa21e87b113d93a10879d311.zip
Diffstat (limited to '')
-rw-r--r--Plugins/Core/oncraftingnorecipe.lua13
1 files changed, 11 insertions, 2 deletions
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