From a3431e2fc60b7bccd6495f7e36571f359bd07a5d Mon Sep 17 00:00:00 2001 From: duncathan Date: Thu, 21 Mar 2019 02:21:30 -0600 Subject: [PATCH] fixes the collection algorithm --- src/database/items.lua | 87 ++++++++++++++++++++++-------------- src/database/world_graph.lua | 5 ++- src/randomizer.lua | 12 ++--- 3 files changed, 65 insertions(+), 39 deletions(-) diff --git a/src/database/items.lua b/src/database/items.lua index 36edd04..548a8fd 100644 --- a/src/database/items.lua +++ b/src/database/items.lua @@ -44,12 +44,12 @@ local function _itemData() polarStar1 = { name = "Polar Star", script = " 0, "No available locations!") + assert(#fillable > 0, ("No available locations for %s! Items left: %d"):format(item.name, #itemsLeft)) assert(item ~= nil, "No item found!") + logDebug(("Placing %s at %s"):format(item.name, fillable[1].name)) fillable[1]:setItem(item) - end + until #itemsLeft == 0 end function C:_fastFillItems(items, locations)