mirror of
https://github.com/sirrobzeroone/elepower.git
synced 2024-12-02 19:43:43 +01:00
Fix stupid power transfer calculation error
This commit is contained in:
parent
a143cc6e11
commit
7f281eadf0
@ -145,7 +145,7 @@ local function give_node_power(pos, available)
|
|||||||
if available >= inrush then
|
if available >= inrush then
|
||||||
total_add = inrush
|
total_add = inrush
|
||||||
elseif available < inrush then
|
elseif available < inrush then
|
||||||
total_add = inrush - available
|
total_add = available
|
||||||
end
|
end
|
||||||
|
|
||||||
if total_add + storage > capacity then
|
if total_add + storage > capacity then
|
||||||
@ -225,7 +225,7 @@ minetest.register_abm({
|
|||||||
|
|
||||||
-- Give power to users
|
-- Give power to users
|
||||||
for _,ndv in ipairs(users) do
|
for _,ndv in ipairs(users) do
|
||||||
if pw_demand >= pw_supply then
|
if pw_demand > pw_supply then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user