summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-05-29 02:51:57 +0000
committerGitHub <noreply@github.com>2026-05-29 02:51:57 +0000
commitb8a3998c51e04e141aaebfb6baf3aaccaade8368 (patch)
treef1251252e90ba2c25f6294d59e0912e66c1e4b2c
parent31cbeb929b16995be56dc943c7f50af605cc0bc6 (diff)
Fix master sword timing info (#6552)
General fix: don't reset timestamp if already set, this is particularly important for retrieving master sword vs ganon Also fix master sword timing not being set when shuffled
-rw-r--r--soh/soh/Enhancements/randomizer/randomizer.cpp47
1 files changed, 13 insertions, 34 deletions
diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp
index 71f88e67d..39a8308f3 100644
--- a/soh/soh/Enhancements/randomizer/randomizer.cpp
+++ b/soh/soh/Enhancements/randomizer/randomizer.cpp
@@ -3589,49 +3589,28 @@ static std::unordered_map<RandomizerGet, GameplayStatTimestamp> randomizerGetToS
// Gameplay stat tracking: Update time the item was acquired
// (special cases for rando items)
void Randomizer_GameplayStats_SetTimestamp(uint16_t item) {
-
u32 time = static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME);
-
// Have items in Link's pocket shown as being obtained at 0.1 seconds
if (time == 0) {
time = 1;
}
- // Use ITEM_KEY_BOSS to timestamp Ganon's boss key
- if (item == RG_GANONS_CASTLE_BOSS_KEY) {
- gSaveContext.ship.stats.itemTimestamp[ITEM_KEY_BOSS] = time;
- return;
- }
-
- if (randomizerGetToStatsTimeStamp.contains((RandomizerGet)item)) {
- gSaveContext.ship.stats.itemTimestamp[randomizerGetToStatsTimeStamp[(RandomizerGet)item]] = time;
- return;
- }
-
- // Count any bottled item as a bottle
- if (item >= RG_EMPTY_BOTTLE && item <= RG_BOTTLE_WITH_BIG_POE) {
- if (gSaveContext.ship.stats.itemTimestamp[ITEM_BOTTLE] == 0) {
+ if (gSaveContext.ship.stats.itemTimestamp[item] == 0) {
+ if (item == RG_GANONS_CASTLE_BOSS_KEY) {
+ gSaveContext.ship.stats.itemTimestamp[ITEM_KEY_BOSS] = time;
+ } else if (item == RG_MASTER_SWORD) {
+ gSaveContext.ship.stats.itemTimestamp[ITEM_SWORD_MASTER] = time;
+ } else if (randomizerGetToStatsTimeStamp.contains((RandomizerGet)item)) {
+ gSaveContext.ship.stats.itemTimestamp[randomizerGetToStatsTimeStamp[(RandomizerGet)item]] = time;
+ } else if (item >= RG_EMPTY_BOTTLE && item <= RG_BOTTLE_WITH_BIG_POE) {
gSaveContext.ship.stats.itemTimestamp[ITEM_BOTTLE] = time;
- }
- return;
- }
-
- // Count any bombchu pack as bombchus
- if ((item >= RG_BOMBCHU_5 && item <= RG_BOMBCHU_20) || item == RG_PROGRESSIVE_BOMBCHU_BAG) {
- if (gSaveContext.ship.stats.itemTimestamp[ITEM_BOMBCHU] = 0) {
+ } else if ((item >= RG_BOMBCHU_5 && item <= RG_BOMBCHU_20) || item == RG_PROGRESSIVE_BOMBCHU_BAG) {
gSaveContext.ship.stats.itemTimestamp[ITEM_BOMBCHU] = time;
+ } else if (item == RG_MAGIC_SINGLE) {
+ gSaveContext.ship.stats.itemTimestamp[ITEM_SINGLE_MAGIC] = time;
+ } else if (item == RG_DOUBLE_DEFENSE) {
+ gSaveContext.ship.stats.itemTimestamp[ITEM_DOUBLE_DEFENSE] = time;
}
- return;
- }
-
- if (item == RG_MAGIC_SINGLE) {
- gSaveContext.ship.stats.itemTimestamp[ITEM_SINGLE_MAGIC] = time;
- return;
- }
-
- if (item == RG_DOUBLE_DEFENSE) {
- gSaveContext.ship.stats.itemTimestamp[ITEM_DOUBLE_DEFENSE] = time;
- return;
}
}