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

mOptionGroups: populate RSG_TRICKS with loop #4909

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Jan 19, 2025

There were some tricks missing, using loop makes one less place to update when adding tricks

Build Artifacts

@serprex
Copy link
Contributor Author

serprex commented Jan 19, 2025

Split out from #4866 since this is a) probably best split out, but also b) a bugfix which should make 9.0.0

auto& trick = mTrickOptions[i];
if (!trick.GetName().empty()) {
mTrickNameToEnum[std::string(trick.GetName())] = static_cast<RandomizerTrick>(i);
auto trick = &mTrickOptions[i];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed declaration because the old way lead to invalid memory references when reference outlived loop into tricksOption

@serprex serprex force-pushed the cleanup-tricks-option-group branch 2 times, most recently from ab0a7e6 to 2d1d31d Compare January 19, 2025 18:07
There were some tricks missing, using loop makes one less place to update when adding tricks
@serprex serprex force-pushed the cleanup-tricks-option-group branch from 2d1d31d to c0ff97a Compare January 19, 2025 19:06
Copy link
Contributor

@aMannus aMannus left a comment

Choose a reason for hiding this comment

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

Definitely better to not have to add them manually and be error prone!

@aMannus aMannus merged commit ed674f1 into HarbourMasters:develop Jan 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants