Skip to content

Commit c84c55e

Browse files
committed
Also drop local round function
1 parent 0f7f343 commit c84c55e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

technic/machines/register/machine_base.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ end
2727

2828
local connect_default = {"bottom", "back", "left", "right"}
2929

30-
local function round(v)
31-
return math.floor(v + 0.5)
32-
end
33-
3430
function technic.register_base_machine(nodename, data)
3531
local colon, modname, name, def = technic.register_compat_v1_to_v2(nodename, data)
3632
local texture_prefix = modname.."_"..name
@@ -138,15 +134,15 @@ function technic.register_base_machine(nodename, data)
138134
local powered = eu_input >= demand
139135
local src_time = meta:get_int("src_time")
140136
if powered then
141-
src_time = src_time + round(def.speed * 10)
137+
src_time = src_time + math.floor(def.speed * 10 + 0.5)
142138
end
143139
while true do
144140
local recipe = inv:get_list("src") and technic.get_recipe(typename, inv:get_list("src"))
145141
if not recipe then
146142
update_node(pos, meta, nodename, infotext_idle, 0, 0)
147143
return
148144
end
149-
local recipe_time = round(recipe.time * 10)
145+
local recipe_time = math.floor(recipe.time * 10 + 0.5)
150146
if src_time < recipe_time then
151147
if powered then
152148
local infotext = infotext_active .. "\n" .. S("Demand: @1", technic.EU_string(demand))

0 commit comments

Comments
 (0)