summaryrefslogtreecommitdiff
path: root/bonemeal.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-06-05 11:39:20 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-06-05 11:39:20 +0100
commit306c025713487b20a20e32e33277d2f215a70832 (patch)
tree681fa828ac02732b2670392e4d30c613c407a579 /bonemeal.lua
parenta3a3934227ec7d56f526ad392690df92fa0165d5 (diff)
Code tweak and tidy
Diffstat (limited to 'bonemeal.lua')
-rw-r--r--bonemeal.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/bonemeal.lua b/bonemeal.lua
index 4f7979b..b1a0174 100644
--- a/bonemeal.lua
+++ b/bonemeal.lua
@@ -170,14 +170,14 @@ local function growth(pointed_thing)
local stage = ""
-- grow registered crops
- for _, row in pairs(crops) do
+ for n = 1, #crops do
- if string.find(node.name, row[1]) then
+ if string.find(node.name, crops[n][1]) then
stage = tonumber( node.name:split("_")[2] )
- stage = math.min(stage + math.random(1, 4), row[2])
+ stage = math.min(stage + math.random(1, 4), crops[n][2])
- minetest.set_node(pos, {name = row[1] .. stage})
+ minetest.set_node(pos, {name = crops[n][1] .. stage})
return