forked from mrkubax10/industrialtest
Use elapsed time to properly calcuate RPM difference in Rotary Macerator
This commit is contained in:
parent
a197d1c2aa
commit
d66a418349
@ -94,7 +94,7 @@ rotaryMacerator.onTimer=function(pos,elapsed,meta,inv)
|
|||||||
shouldRerunTimer,shouldUpdateFormspec=industrialtest.internal.chargeFromPowerStorageItem(meta,inv)
|
shouldRerunTimer,shouldUpdateFormspec=industrialtest.internal.chargeFromPowerStorageItem(meta,inv)
|
||||||
|
|
||||||
if rpm>0 then
|
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
|
shouldRerunTimer=shouldRerunTimer or rpm>0
|
||||||
shouldUpdateFormspec=true
|
shouldUpdateFormspec=true
|
||||||
end
|
end
|
||||||
@ -200,7 +200,7 @@ rotaryMacerator.activeOnTimer=function(pos,elapsed,meta,inv)
|
|||||||
meta:set_float("maxSrcTime",0)
|
meta:set_float("maxSrcTime",0)
|
||||||
srcSlot:set_count(srcSlot:get_count()-multiplier)
|
srcSlot:set_count(srcSlot:get_count()-multiplier)
|
||||||
inv:set_stack("src",1,srcSlot)
|
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
|
if modified then
|
||||||
local modifierMeta=modifierSlot:get_meta()
|
local modifierMeta=modifierSlot:get_meta()
|
||||||
local uses=result.uses
|
local uses=result.uses
|
||||||
|
Loading…
x
Reference in New Issue
Block a user