diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2022-11-29 22:43:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-29 22:43:05 -0500 |
| commit | 00a862a252cb1c0e0cb3e37beec4f42010ff54a5 (patch) | |
| tree | f5da80e5ba0aef5772bfc8397ce9fb0c93f7dce4 /soh/src/code | |
| parent | 806b9dc84ba30b04aa6cd19bc91e85513d4acdb9 (diff) | |
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>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_sram.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 5fb913083..7d9d85b68 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -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); } } |
