summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorMalkierian <malkierian@live.com>2023-11-14 14:35:19 -0700
committerGitHub <noreply@github.com>2023-11-14 16:35:19 -0500
commit4e9040d761dfcda2b0788364f76cef2ae8fe70ba (patch)
treeec05e943fa0f193e4fea66695916dd8ffb813aed /soh/src/code
parent304016ddd2ac45e5101e03faa66f0a88f431d213 (diff)
[Feature] Remove `performDelayedSave` functionality from Autosave (#3387)
* Removes delayed save functionality, making autosave work everywhere except Ganon and Chamber of Sages scenes. * Change AutoSave comment to remove the scenarios we no longer block autosave in. * handle temp B on saving outside of kaleido --------- Co-authored-by: Adam Bird <archez39@me.com>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_play.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index bf7016884..841de8f13 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -2329,8 +2329,28 @@ void Play_PerformSave(PlayState* play) {
if (play != NULL && gSaveContext.fileNum != 0xFF) {
Play_SaveSceneFlags(play);
gSaveContext.savedSceneNum = play->sceneNum;
+
+ // Track values from temp B
+ uint8_t prevB = gSaveContext.equips.buttonItems[0];
+ uint8_t prevStatus = gSaveContext.buttonStatus[0];
+
+ // Replicate the B button restore from minigames/epona that kaleido does
+ if (gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT ||
+ gSaveContext.equips.buttonItems[0] == ITEM_BOW ||
+ gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU ||
+ gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE ||
+ (gSaveContext.equips.buttonItems[0] == ITEM_NONE && !Flags_GetInfTable(INFTABLE_SWORDLESS))) {
+
+ gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0];
+ Interface_RandoRestoreSwordless();
+ }
+
Save_SaveFile();
+ // Restore temp B values back
+ gSaveContext.equips.buttonItems[0] = prevB;
+ gSaveContext.buttonStatus[0] = prevStatus;
+
uint8_t triforceHuntCompleted =
IS_RANDO &&
gSaveContext.triforcePiecesCollected == Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) &&