forked from MineClone5/MineClone5
Fix skipping growth stages of mcl_farming plants
Because usually math.ceil(intervals_counter)>=1, stages + math.ceil(intervals_counter)>=2. It causes the plants to skip growth stages and they usually grow two stages at once. Changing ceil to floor seems to solve the problem.
This commit is contained in:
parent
e2e4f7d2df
commit
5b56acd415
|
@ -129,7 +129,7 @@ function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light, low
|
||||||
if not stages then
|
if not stages then
|
||||||
stages = 1
|
stages = 1
|
||||||
end
|
end
|
||||||
stages = stages + math.ceil(intervals_counter)
|
stages = stages + math.floor(intervals_counter)
|
||||||
local new_node = {name = plant_info.names[step+stages]}
|
local new_node = {name = plant_info.names[step+stages]}
|
||||||
if new_node.name == nil then
|
if new_node.name == nil then
|
||||||
new_node.name = plant_info.full_grown
|
new_node.name = plant_info.full_grown
|
||||||
|
|
Loading…
Reference in New Issue