Skip to content

Commit

Permalink
fix: used-bottles-store crashing with a bad argument to generator (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
xor-bits authored Sep 13, 2024
1 parent e61d0fb commit 548e383
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions used-bottles-store.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ local function return_used_bottles(city)
for _, entry in pairs(stations_with_space) do
if entry.available_slots > 1 then
local share_per_station = math.ceil(current_count / #stations)
if share_per_station == 0 then
break
end
local target_quantity = city.generator(share_per_station)
local quantity = math.min(share_per_station, target_quantity)
local used_bottles_stack_size = 50 -- todo: can we load this from the prototype?
Expand Down

0 comments on commit 548e383

Please sign in to comment.