mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-14 00:53:07 -07:00
use trial enum instead of magic numbers (#2039)
* use trial enum instead of magic numbers * simplify trial count/random trial logic * set default to set number Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
parent
806b9dc84b
commit
00a862a252
5 changed files with 18 additions and 20 deletions
|
@ -324,12 +324,10 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
|
|||
gSaveContext.randomizerInf[i] = 0;
|
||||
}
|
||||
|
||||
// Set all trials to cleared if trial count is random or anything other than 6
|
||||
if (Randomizer_GetSettingValue(RSK_RANDOM_TRIALS) || (Randomizer_GetSettingValue(RSK_TRIAL_COUNT) != 6)) {
|
||||
for (u16 i = RAND_INF_TRIALS_DONE_LIGHT_TRIAL; i <= RAND_INF_TRIALS_DONE_SHADOW_TRIAL; i++) {
|
||||
if (!Randomizer_IsTrialRequired(i)) {
|
||||
Flags_SetRandomizerInf(i);
|
||||
}
|
||||
// If any trials aren't required, set them as completed
|
||||
for (u16 i = RAND_INF_TRIALS_DONE_LIGHT_TRIAL; i <= RAND_INF_TRIALS_DONE_SHADOW_TRIAL; i++) {
|
||||
if (!Randomizer_IsTrialRequired(i)) {
|
||||
Flags_SetRandomizerInf(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue