From 544460d90941fb1d845abe8d5158423a52880ba3 Mon Sep 17 00:00:00 2001 From: Sirius902 <10891979+Sirius902@users.noreply.github.com> Date: Mon, 30 Jan 2023 05:43:30 -0800 Subject: [PATCH] QPA restoration (#2422) --- soh/soh/Enhancements/presets.h | 7 +++++++ soh/soh/GameMenuBar.cpp | 2 ++ soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index bcda84b95..91bdac3a6 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -157,6 +157,7 @@ const std::vector enhancementsCvars = { "gHoverFishing", "gN64WeirdFrames", "gBombchusOOB", + "gQuickPutaway", "gGsCutscene", "gSkipSaveConfirmation", "gAutosave", @@ -359,6 +360,8 @@ const std::vector vanillaPlusPresetEntries = { PRESET_ENTRY_S32("gN64WeirdFrames", 1), // Bombchus out of bounds PRESET_ENTRY_S32("gBombchusOOB", 1), + // Quick Putaway + PRESET_ENTRY_S32("gQuickPutaway", 1), // Skip save confirmation PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), }; @@ -424,6 +427,8 @@ const std::vector enhancedPresetEntries = { PRESET_ENTRY_S32("gN64WeirdFrames", 1), // Bombchus out of bounds PRESET_ENTRY_S32("gBombchusOOB", 1), + // Quick Putaway + PRESET_ENTRY_S32("gQuickPutaway", 1), // Skip save confirmation PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), // Biggoron Forge Time (0 to 3) @@ -538,6 +543,8 @@ const std::vector randomizerPresetEntries = { PRESET_ENTRY_S32("gN64WeirdFrames", 1), // Bombchus out of bounds PRESET_ENTRY_S32("gBombchusOOB", 1), + // Quick Putaway + PRESET_ENTRY_S32("gQuickPutaway", 1), // Skip save confirmation PRESET_ENTRY_S32("gSkipSaveConfirmation", 1), // Biggoron Forge Time (0 to 3) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 0a778bb80..6fb66cfc9 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -794,6 +794,8 @@ namespace GameMenuBar { UIWidgets::Tooltip("Restores N64 Weird Frames allowing weirdshots to behave the same as N64"); UIWidgets::PaddedEnhancementCheckbox("Bombchus out of bounds", "gBombchusOOB", true, false); UIWidgets::Tooltip("Allows bombchus to explode out of bounds\nSimilar to GameCube and Wii VC"); + UIWidgets::PaddedEnhancementCheckbox("Quick Putaway", "gQuickPutaway", true, false); + UIWidgets::Tooltip("Restore a bug from NTSC 1.0 that allows putting away an item without an animation and performing Putaway Ocarina Items"); UIWidgets::PaddedEnhancementCheckbox("Restore old Gold Skulltula cutscene", "gGsCutscene", true, false); ImGui::EndMenu(); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 135dc8eff..dca3c6a19 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2167,7 +2167,7 @@ void func_808340DC(Player* this, PlayState* play) { } void func_80834298(Player* this, PlayState* play) { - if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & PLAYER_STATE1_8) && + if ((this->actor.category == ACTORCAT_PLAYER) && (CVarGetInteger("gQuickPutaway", 0) || !(this->stateFlags1 & PLAYER_STATE1_8)) && ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) && (gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) && (play->shootingGalleryStatus == 0) && (play->activeCamera == MAIN_CAM) &&