Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions source/fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,25 @@ static void FastFill(std::vector<ItemKey> items, std::vector<LocationKey> locati
PlacementLog_Msg("\n Attempted to place " + ItemTable(item).GetName().GetEnglish() + " at " + Location(loc)->GetName());
items.push_back(item);
locations.push_back(loc);
}
else {*/
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, item);

if (items.empty() && !endOnItemsEmpty) {
items.push_back(GetJunkItem());
}*/
if (NoRepeatOnTokens) {
//put back the last item we picked up
items.push_back(item);
//then put the unused items back into the main pool and stop
AddElementsToPool(ItemPool, items);
break;
}
else {
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, item);
if (items.empty() && !endOnItemsEmpty) {
items.push_back(GetJunkItem());
}
}
}
}


/*
| The algorithm places items in the world in reverse.
| This means we first assume we have every item in the item pool and
Expand Down Expand Up @@ -879,24 +887,13 @@ int Fill() {
//Get NonRepeatItems
std::vector<ItemKey> NonRepeatItems = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return !ItemTable(i).IsReusable();});
//fill SSH spots with nonrepeatableitems
//CitraPrint("Items in NonRepeatItems:\n");
//PlacementLog_Msg("Items in NonRepeatItems:\n");
//for (ItemKey item : NonRepeatItems) {
// CitraPrint(ItemTable(item).GetName().GetEnglish() + "\n");
// PlacementLog_Msg(ItemTable(item).GetName().GetEnglish() + "\n");
// }
AssumedFill(NonRepeatItems, SwampSkullLocations, true);

//Get OSH locations
std::vector<LocationKey> OceanSkullLocations = FilterFromPool(allLocations, [](const LocationKey loc1) {return Location(loc1)->IsCategory(Category::cOceanSkulltula);});
//Get NonRepeatItems
std::vector<ItemKey> NonRepeatItems2 = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return !ItemTable(i).IsReusable();});
//CitraPrint("Items in NonRepeatItems2:\n");
//PlacementLog_Msg("Items in NonRepeatItems2:\n");
//for (ItemKey item : NonRepeatItems2) {
// CitraPrint(ItemTable(item).GetName().GetEnglish() + "\n");
// PlacementLog_Msg(ItemTable(item).GetName().GetEnglish() + "\n");
// }
//fill OSH spots with NonRepeatableItems
AssumedFill(NonRepeatItems2, OceanSkullLocations, true);
//Set Variable back to false to go back to normal filling
Expand Down