Skip to content

Fix: Various Rando generation crashes#3108

Merged
leggettc18 merged 3 commits intoHarbourMasters:develop-sulufrom
Archez:fix-rando-gen-crashes
Aug 12, 2023
Merged

Fix: Various Rando generation crashes#3108
leggettc18 merged 3 commits intoHarbourMasters:develop-sulufrom
Archez:fix-rando-gen-crashes

Conversation

@Archez
Copy link
Contributor

@Archez Archez commented Aug 7, 2023

Fixes possible rando generation crashes by:

  • Add missing granny shop hint text
  • Move empty item pool/append junk item check to before trying to access a random element

I also made it so the rando gen success sound (horse goal) only plays when the seed generates correctly. If it fails, it now plays an error tone (failed ocarina song).

Build Artifacts

Copy link
Contributor

@briaguya0 briaguya0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment on lines 550 to 558
while (!locations.empty() && (!endOnItemsEmpty || !items.empty())) {
uint32_t loc = RandomElement(locations, true);
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, RandomElement(items, true));

if (items.empty() && !endOnItemsEmpty) {
items.push_back(GetJunkItem());
}

uint32_t loc = RandomElement(locations, true);
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, RandomElement(items, true));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a change that needs to be PR'd to 3drando or is it a fix from 3drando that we didn't have yet?

Copy link
Contributor Author

@Archez Archez Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not in 3drando, and could be upstreamed

@garrettjoecox
Copy link
Contributor

Re-adding merge ready label as criteria is now met (3 approvals & 3+ days since first)

@leggettc18 leggettc18 merged commit 535157c into HarbourMasters:develop-sulu Aug 12, 2023
@Archez Archez deleted the fix-rando-gen-crashes branch August 12, 2023 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants