From 7dbea2deb5335faebdb3f80ce4bb301434e0b775 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Sat, 2 May 2015 19:03:17 -0700 Subject: Start of getting humidity to work for potatoes. --- init.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 48ecd08..a5ad48f 100644 --- a/init.lua +++ b/init.lua @@ -41,6 +41,7 @@ local find_plant = function(node) return crops.plants[i] end end + minetest.log("error", "Unable to find plant \"" .. node.name .. "\" in crops table") return nil end @@ -68,7 +69,8 @@ crops.can_grow = function(pos) return false end end - local plant = find_plant(pos) + local node = minetest.get_node(pos) + local plant = find_plant(node) if not plant then return false end @@ -213,7 +215,8 @@ dofile(modpath .. "/polebean.lua") -- water handling code minetest.register_abm({ nodenames = { - "crops:tomato_plant_1", "crops:tomato_plant_2", "crops:tomato_plant_3", "crops:tomato_plant_4", "crops:tomato_plant_5" + "crops:tomato_plant_1", "crops:tomato_plant_2", "crops:tomato_plant_3", "crops:tomato_plant_4", "crops:tomato_plant_5", + "crops:potato_plant_1", "crops:potato_plant_2", "crops:potato_plant_3", "crops:potato_plant_4" }, interval = crops.interval, chance = crops.chance, @@ -225,7 +228,6 @@ minetest.register_abm({ -- get plant specific data local plant = find_plant(node) if plant == nil then - -- FIXME - throw error? return end -- cgit v1.2.3