Skip to content

Commit

Permalink
Fix inadvertent breakage of endless resources
Browse files Browse the repository at this point in the history
  • Loading branch information
narc0tiq committed Sep 20, 2016
1 parent f89f146 commit c0d7ccf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ end


function resmon.tick_deposit_count(site)
local entity_prototype = game.entity_prototypes[site.ore_type]

local key, pos
key = site.iter_key
for _ = 1, 100 do
Expand Down Expand Up @@ -444,6 +442,8 @@ function resmon.finish_deposit_count(site)
site.last_ore_check = game.tick

site.remaining_permille = math.floor(site.amount * 1000 / site.initial_amount)

local entity_prototype = game.entity_prototypes[site.ore_type]
if resmon.is_endless_resource(site.ore_type, entity_prototype) then
-- calculate remaining permille as:
-- how much of the minimum amount does the site have in excess to the site minimum amount?
Expand Down

0 comments on commit c0d7ccf

Please sign in to comment.