mirror of
https://github.com/sirrobzeroone/elepower.git
synced 2024-11-30 18:43:49 +01:00
Rearrange generator timer refresh setters
This commit is contained in:
parent
54b1809f8f
commit
2eb0062491
@ -84,7 +84,7 @@ function ele.register_fluid_generator(nodename, nodedef)
|
||||
|
||||
status = "Active"
|
||||
|
||||
-- Burn another bucket of lava
|
||||
-- Burn another bucket of fluid fuel
|
||||
if burn_time == 0 then
|
||||
if not flbuffer or flbuffer.fluid == "" then break end
|
||||
|
||||
@ -93,7 +93,7 @@ function ele.register_fluid_generator(nodename, nodedef)
|
||||
meta:set_int("burn_time", btime)
|
||||
meta:set_int("burn_totaltime", btime)
|
||||
|
||||
-- Take lava
|
||||
-- Take fluid fuel
|
||||
flbuffer.amount = flbuffer.amount - busage
|
||||
pow_buffer.usage = generation
|
||||
|
||||
@ -110,6 +110,8 @@ function ele.register_fluid_generator(nodename, nodedef)
|
||||
else
|
||||
status = "Idle"
|
||||
ele.helpers.swap_node(pos, nodename)
|
||||
|
||||
refresh = false
|
||||
end
|
||||
end
|
||||
if burn_totaltime == 0 then burn_totaltime = 1 end
|
||||
|
@ -60,7 +60,7 @@ function elepm.register_fuel_generator(nodename, nodedef)
|
||||
-- If more to burn and the energy produced was used: produce some more
|
||||
if burn_time > 0 then
|
||||
if storage + generation > capacity then
|
||||
return false
|
||||
break
|
||||
end
|
||||
|
||||
pow_buffer.storage = pow_buffer.storage + generation
|
||||
@ -68,6 +68,8 @@ function elepm.register_fuel_generator(nodename, nodedef)
|
||||
|
||||
burn_time = burn_time - 1
|
||||
meta:set_int("burn_time", burn_time)
|
||||
|
||||
refresh = true
|
||||
end
|
||||
|
||||
status = "Active"
|
||||
@ -102,6 +104,8 @@ function elepm.register_fuel_generator(nodename, nodedef)
|
||||
else
|
||||
status = "Idle"
|
||||
ele.helpers.swap_node(pos, nodename)
|
||||
|
||||
refresh = false
|
||||
end
|
||||
end
|
||||
if burn_totaltime == 0 then burn_totaltime = 1 end
|
||||
|
Loading…
Reference in New Issue
Block a user