diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index 5973fdcee..1f195251b 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -533,17 +533,17 @@ int32_t getRandomWeight(int32_t totalWeight){ static void DistributeHints(std::vector& selected, size_t stoneCount, std::vector distTable, uint8_t junkWieght, bool addFixed = true){ int32_t totalWeight = junkWieght; //Start with our Junk Weight, the natural chance of a junk hint - for (HintDistributionSetting setting: distTable){ //Gather the wieghts of each distribution and, if it's the first pass, apply fixed hints - totalWeight += setting.weight; //Note that PlaceHints will set weights of distributions to zero if it can't place anything from them + for (size_t c=0; c < distTable.size(); c++){ //Gather the wieghts of each distribution and, if it's the first pass, apply fixed hints + totalWeight += distTable[c].weight; //Note that PlaceHints will set weights of distributions to zero if it can't place anything from them if (addFixed){ - selected[setting.type] += setting.fixed; - stoneCount -= setting.fixed * setting.copies; + selected[c] += distTable[c].fixed; + stoneCount -= distTable[c].fixed * distTable[c].copies; } } int32_t currentWeight = getRandomWeight(totalWeight); //Initialise with the first random weight from 1 to the total. while(stoneCount > 0 && totalWeight > 0){//Loop until we run out of stones or have no TotalWeight. 0 totalWeight means junkWeight is 0 //and that all weights have been 0'd out for another reason, and skips to placing all junk hints - for (uint8_t distribution = 0; distribution < distTable.size(); distribution++){ + for (size_t distribution = 0; distribution < distTable.size(); distribution++){ currentWeight -= distTable[distribution].weight; //go over each distribution, subtracting the weight each time. Once we reach zero or less, if (currentWeight <= 0){ //tell the system to make 1 of that hint, unless not enough stones remain if (stoneCount >= distTable[distribution].copies && distTable[distribution].copies > 0){ @@ -650,7 +650,7 @@ void CreateStoneHints() { size_t totalStones = GetEmptyGossipStones().size(); std::vector selectedHints = {}; - for (uint8_t c=0; c < distTable.size(); c++){ + for (size_t c=0; c < distTable.size(); c++){ selectedHints.push_back(0); } selectedHints.push_back(0); @@ -672,7 +672,7 @@ void CreateStoneHints() { std::vector FindItemsAndMarkHinted(std::vector items, std::vector hintChecks){ std::vector locations = {}; auto ctx = Rando::Context::GetInstance(); - for (uint8_t c = 0; c < items.size(); c++){ + for (size_t c = 0; c < items.size(); c++){ std::vector found = FilterFromPool(ctx->allLocations, [items, ctx, c](const RandomizerCheck loc) { return ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == items[c];}); if (found.size() > 0){