Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Various Rando generation crashes #3108

Merged
merged 3 commits into from
Aug 12, 2023

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

@briaguya-ai briaguya-ai 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
8 checks passed
@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.

None yet

4 participants