diff options
author | tenplus1 <kinsellaja@yahoo.com> | 2015-05-21 20:26:57 +0100 |
---|---|---|
committer | tenplus1 <kinsellaja@yahoo.com> | 2015-05-21 20:26:57 +0100 |
commit | 84dc9643b14891c997761f30be96147b8c064943 (patch) | |
tree | 68a8499f0d9d5d8c332f3bea07b6440630a3248d | |
parent | 7ff3416737a5a05242114945c6ddc34393ddfd54 (diff) |
Fixed nil compare bug
-rw-r--r-- | init.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -338,12 +338,12 @@ function farming.plant_growth_timer(pos, elapsed, node_name) local lambda = elapsed / STAGE_LENGTH_AVG if lambda < 0.1 then return true end if max_growth == 1 or lambda < 2.0 then - local light = minetest.get_node_light(light_pos) + local light = (minetest.get_node_light(light_pos) or 0) -- CHANGED if not in_range(light, MIN_LIGHT, MAX_LIGHT) then return true end growth = 1 else - local night_light = minetest.get_node_light(light_pos, 0) - local day_light = minetest.get_node_light(light_pos, 0.5) + local night_light = (minetest.get_node_light(light_pos, 0) or 0) -- CHANGED + local day_light = (minetest.get_node_light(light_pos, 0.5) or 0) -- ChANGED local night_growth = in_range(night_light, MIN_LIGHT, MAX_LIGHT) local day_growth = in_range(day_light, MIN_LIGHT, MAX_LIGHT) |