Reimplements vanilla bug, adds cvar and checkbox for the fix.

This commit is contained in:
Christopher Leggett 2022-05-19 22:14:02 -04:00
commit ff4966f146
No known key found for this signature in database
GPG key ID: 7093AE5FF7037D79
3 changed files with 15 additions and 5 deletions

View file

@ -705,6 +705,8 @@ namespace SohImGui {
Tooltip("Show dungeon entrances icon only when it should be"); Tooltip("Show dungeon entrances icon only when it should be");
EnhancementCheckbox("Fix Two Handed idle animations", "gTwoHandedIdle"); EnhancementCheckbox("Fix Two Handed idle animations", "gTwoHandedIdle");
Tooltip("Makes two handed idle animation play, a seemingly finished animation that was disabled on accident in the original game"); Tooltip("Makes two handed idle animation play, a seemingly finished animation that was disabled on accident in the original game");
EnhancementCheckbox("Fix the Gravedigging Tour Glitch", "gGravediggingTourFix");
Tooltip("Fixes a vanilla bug where you can permanently miss the Gravedigging Tour Heart Piece in Kakariko Graveyard if you spawn the Heart Piece and leave without picking it up");
ImGui::EndMenu(); ImGui::EndMenu();
} }

View file

@ -31,6 +31,7 @@ void BootCommands_Init()
CVar_RegisterS32("gNewDrops", 0); CVar_RegisterS32("gNewDrops", 0);
CVar_RegisterS32("gVisualAgony", 0); CVar_RegisterS32("gVisualAgony", 0);
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
CVar_RegisterS32("gGravediggingTourFix", 0);
} }
//void BootCommands_ParseBootArgs(char* str) //void BootCommands_ParseBootArgs(char* str)

View file

@ -606,21 +606,28 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
rewardPos.z += this->actor.world.pos.z; rewardPos.z += this->actor.world.pos.z;
this->currentReward = EnTk_ChooseReward(this); this->currentReward = EnTk_ChooseReward(this);
s32 collectibleParams = rewardParams[this->currentReward]; this->currentReward = 3;
if (this->currentReward == 3) { if (this->currentReward == 3) {
/* /*
* Upgrade the purple rupee reward to the heart piece if this * Upgrade the purple rupee reward to the heart piece if this
* is the first grand prize dig. * is the first grand prize dig.
*/ */
if (Flags_GetCollectible(globalCtx, 0x19) == 0) { // Initialized with bugfixed condition, overriden with original check if bugfix cvar is 0 (which is default).
bool condition = Flags_GetCollectible(globalCtx, 0x19) == 0;
if (CVar_GetS32("gGravediggingTourFix", 0) == 0) {
condition = !(gSaveContext.itemGetInf[1] & 0x1000);
}
if (condition) {
this->currentReward = 4; this->currentReward = 4;
collectibleParams = ITEM00_HEART_PIECE; gSaveContext.itemGetInf[1] |= 0x1000;
} }
} }
EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, collectibleParams); EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]);
if (this->currentReward == 4) { if (this->currentReward == 4) {
reward->collectibleFlag = 0x19; if (CVar_GetS32("gGravediggingTourFix", 0) != 0) {
reward->collectibleFlag = 0x19;
}
} }
} }
} }