summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-05-26 16:09:15 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-05-26 16:09:15 +0100
commit1d3e688af65eb632783c532dbaac8275579a4f86 (patch)
tree94505e193c7f5354757fcee89791475707e5ec18
parentdd422b609164b338c4a68166b78a1d7d2d9e5250 (diff)
fix issue with mod names containing _ char
-rw-r--r--init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 8b0a8b2..fce9fbb 100644
--- a/init.lua
+++ b/init.lua
@@ -176,7 +176,7 @@ end
-- crops check
local function check_crops(pos, nodename, strength)
- local stage, nod, def
+ local mod, crop, stage, nod, def
-- grow registered crops
for n = 1, #crops do
@@ -184,8 +184,12 @@ local function check_crops(pos, nodename, strength)
if string.find(nodename, crops[n][1])
or nodename == crops[n][3] then
+ -- separate mod and node name
+ mod = nodename:split(":")[1] .. ":"
+ crop = nodename:split(":")[2]
+
-- get stage number or set to 0 for seed
- stage = tonumber( nodename:split("_")[2] ) or 0
+ stage = tonumber( crop:split("_")[2] ) or 0
stage = math.min(stage + strength, crops[n][2])
-- check for place_param setting