Skip to content

Commit

Permalink
* Move comment
Browse files Browse the repository at this point in the history
  • Loading branch information
avosirenfal committed Apr 9, 2017
1 parent f9fdbcb commit 700c885
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Localized_Charging_1.0.0/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ script.on_event(defines.events.on_tick, function(event)
error('Localized Charging: invalid tower split: ' .. tostring(s))
end

-- use ceil here to counter float imprecision
local transfer = interface.energy / s --math.ceil(math.min(item.max_energy - item.energy, interface.energy / s))
local transfer = interface.energy / s

-- we've partitioned off the energy we need
split[tower.unit_number] = split[tower.unit_number] - 1

repeat
local spent = item.energy
-- use ceil here to counter float imprecision
item.energy = item.energy + math.ceil(transfer * power_info.efficiency)
spent = (item.energy - spent) * (1 / power_info.efficiency)

Expand Down

0 comments on commit 700c885

Please sign in to comment.