diff options
author | kilbith <jeanpatrick.guerrero@gmail.com> | 2015-06-06 12:16:21 +0200 |
---|---|---|
committer | kilbith <jeanpatrick.guerrero@gmail.com> | 2015-06-06 12:17:39 +0200 |
commit | 26799d2263a246006eb6995783f19b90f2105d56 (patch) | |
tree | 2305ea5f82d1bc8e706f788d31f7bfc65679663d /circular_saw.lua | |
parent | 7bd98ac02c0dd848e07b4c2202d20c47dc45999b (diff) |
Speedup remnant stack calculation
Diffstat (limited to 'circular_saw.lua')
-rw-r--r-- | circular_saw.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/circular_saw.lua b/circular_saw.lua index eeb62b5..4735dcd 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -93,9 +93,10 @@ function circular_saw:get_output_inv(modname, material, amount, max) for i, t in ipairs(circular_saw.names) do local cost = circular_saw.cost_in_microblocks[i] + local balance = math.min(math.floor(amount/cost), max) pos = pos + 1 list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2] - .. " " .. math.min(math.floor(amount/cost), max) + .. " " .. balance end return list end |