use enum for starting age (#2085)

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2022-12-06 00:34:30 -05:00 committed by GitHub
parent acd07f2a07
commit 321e563c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -570,7 +570,7 @@ const std::vector<PresetEntry> s6PresetEntries = {
PRESET_ENTRY_S32("gRandomizeSkipChildZelda", 1),
PRESET_ENTRY_S32("gRandomizeSkipEponaRace", 1),
PRESET_ENTRY_S32("gRandomizeSkipTowerEscape", 1),
PRESET_ENTRY_S32("gRandomizeStartingAge", 2),
PRESET_ENTRY_S32("gRandomizeStartingAge", RO_AGE_RANDOM),
PRESET_ENTRY_S32("gRandomizeStartingConsumables", 1),
PRESET_ENTRY_S32("gRandomizeStartingDekuShield", 1),
PRESET_ENTRY_S32("gRandomizeStartingMapsCompasses", 0),
@ -621,7 +621,7 @@ const std::vector<PresetEntry> hellModePresetEntries = {
PRESET_ENTRY_S32("gRandomizeSkipEponaRace", 1),
PRESET_ENTRY_S32("gRandomizeSkipScarecrowsSong", 1),
PRESET_ENTRY_S32("gRandomizeSkipTowerEscape", 1),
PRESET_ENTRY_S32("gRandomizeStartingAge", 2),
PRESET_ENTRY_S32("gRandomizeStartingAge", RO_AGE_RANDOM),
PRESET_ENTRY_S32("gRandomizeStartingMapsCompasses", 5),
PRESET_ENTRY_S32("gRandomizeSunlightArrows", 1),
PRESET_ENTRY_S32("gRandomizeZorasFountain", 2),

View File

@ -2565,7 +2565,7 @@ void GenerateRandomizerImgui() {
cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", RO_KAK_GATE_CLOSED);
cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED);
cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0);
cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0);
cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", RO_AGE_CHILD);
cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL);
cvarSettings[RSK_RAINBOW_BRIDGE] = CVar_GetS32("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA);
cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVar_GetS32("gRandomizeStoneCount", 3);

View File

@ -1508,7 +1508,7 @@ void Inventory_SwapAgeEquipment(void) {
gSaveContext.equips.equipment = gSaveContext.childEquips.equipment;
gSaveContext.equips.equipment &= 0xFFF0;
gSaveContext.equips.equipment |= 0x0001;
} else if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_STARTING_AGE)) {
} else if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_STARTING_AGE) == RO_AGE_ADULT) {
/*If in rando and starting age is adult, childEquips is not initialized and buttonItems[0]
will be ITEM_NONE. When changing age from adult -> child, reset equips to "default"
(only kokiri tunic/boots equipped, no sword, no C-button items, no D-Pad items).

View File

@ -383,12 +383,12 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
int startingAge = Randomizer_GetSettingValue(RSK_STARTING_AGE);
switch (startingAge) {
case 1: //Adult
case RO_AGE_ADULT: //Adult
gSaveContext.linkAge = 0;
gSaveContext.entranceIndex = 0x5F4;
gSaveContext.savedSceneNum = SCENE_SPOT20; //Set scene num manually to ToT
break;
case 0: //Child
case RO_AGE_CHILD: //Child
gSaveContext.linkAge = 1;
break;
default: