Use elapsed time to properly calcuate RPM difference in Rotary Macerator

This commit is contained in:
mrkubax10 2024-03-10 21:35:10 +01:00
parent a197d1c2aa
commit d66a418349

View File

@ -94,7 +94,7 @@ rotaryMacerator.onTimer=function(pos,elapsed,meta,inv)
shouldRerunTimer,shouldUpdateFormspec=industrialtest.internal.chargeFromPowerStorageItem(meta,inv)
if rpm>0 then
meta:set_int("rpm",math.max(rpm-1000,0))
meta:set_int("rpm",math.max(rpm-1000*elapsed,0))
shouldRerunTimer=shouldRerunTimer or rpm>0
shouldUpdateFormspec=true
end
@ -200,7 +200,7 @@ rotaryMacerator.activeOnTimer=function(pos,elapsed,meta,inv)
meta:set_float("maxSrcTime",0)
srcSlot:set_count(srcSlot:get_count()-multiplier)
inv:set_stack("src",1,srcSlot)
meta:set_int("rpm",math.min(rpm+750,7500))
meta:set_int("rpm",math.min(rpm+750*elapsed,7500))
if modified then
local modifierMeta=modifierSlot:get_meta()
local uses=result.uses