summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
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) &&