]> git.lizzy.rs Git - xdecor.git/commitdiff
Enchanting: Do not assume groupcaps times always go from 1 to 3
authorLeMagnesium <mg.minetest@gmail.com>
Sun, 28 Feb 2016 21:23:07 +0000 (22:23 +0100)
committerJean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
Sun, 28 Feb 2016 21:25:48 +0000 (22:25 +0100)
enchanting.lua

index 38c8a6cd3403db72123c77cf159756949404fa7a..1ec88d5561259a585e5633c03ce0b6b1afe7e00b 100644 (file)
@@ -169,8 +169,8 @@ for enchant in tooldef[2]:gmatch("[%w_]+") do
                        if enchant == "durable" then
                                groupcaps[group].uses = math.ceil(original_groupcaps[group].uses * enchanting.uses)
                        elseif enchant == "fast" then
-                               for i = 1, 3 do
-                                       groupcaps[group].times[i] = original_groupcaps[group].times[i] - enchanting.times
+                               for i, time in pairs(original_groupcaps[group].times) do
+                                       groupcaps[group].times[i] = time - enchanting.times
                                end
                        elseif enchant == "sharp" then
                                fleshy = fleshy + enchanting.damages