From ba48afe9080fdba05a94fc7b66f31bda4264c749 Mon Sep 17 00:00:00 2001 From: Lethosor Date: Fri, 16 Dec 2016 14:22:00 -0500 Subject: [PATCH] stockflow: Simplify calculation See #1046 Use math.floor() for now until we can get Lua 5.3 working on Travis --- 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 32fc342fb..dd83e65d9 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -1135,8 +1135,7 @@ function check_stockpiles(verbose) if trigger and trigger.divisor then 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 + local amount = math.floor((trigger.filled and filled or empty) / trigger.divisor) result[reaction] = (result[reaction] or 0) + amount end end