Skip to content

Commit

Permalink
stockflow: Use "floor division"
Browse files Browse the repository at this point in the history
Per suggestion by @dscorbett
  • Loading branch information
ab9rf committed Dec 16, 2016
1 parent 5be77fa commit 1419d58
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/lua/stockflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,7 @@ function check_stockpiles(verbose)
local reaction = spec.entry.ints[entry_ints.order_number]
local filled, empty = check_pile(spec.stockpile, verbose)
local amount = trigger.filled and filled or empty
amount = (amount - (amount % trigger.divisor)) / trigger.divisor
amount = math.floor(amount)
amount = (amount - (amount % trigger.divisor)) // trigger.divisor
result[reaction] = (result[reaction] or 0) + amount
end
end
Expand Down

0 comments on commit 1419d58

Please sign in to comment.