From 1419d58b9a6d074edb0d56deda62f5f2e4f12852 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Fri, 16 Dec 2016 13:04:51 -0600 Subject: [PATCH] stockflow: Use "floor division" Per suggestion by @dscorbett --- plugins/lua/stockflow.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index 510718ff1..32fc342fb 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -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