Fixes the Gravedigging Tour heartpiece bug.

Basically just causes Dampe's Gravedigging Tour Heart Piece to set a Collect flag on the Graveyard Scene when collected instead of a GetItemInf flag when it's spawned. I did this by simply the result of Item_DropCollectible to a variable called reward and running reward->collectibleFlag = 0x19 if the reward was a heartpiece.

There may be a better way to do this. This is unlike most of the other dropped items with collectible flags in the game, which have some binary operations performed on the item to be dropped before passing it into Item_DropCollectible. See z_en_geldb.c and z_bg_haka_tubo.c for examples of this. I tried to find some way to do something more like that here but I was unable to wrap my head around the binary operations being performed. I may revisit this in the future.
This commit is contained in:
Christopher Leggett 2022-05-19 21:43:45 -04:00
commit 70e2067fa2
No known key found for this signature in database
GPG key ID: 7093AE5FF7037D79

View file

@ -606,18 +606,22 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
rewardPos.z += this->actor.world.pos.z;
this->currentReward = EnTk_ChooseReward(this);
s32 collectibleParams = rewardParams[this->currentReward];
if (this->currentReward == 3) {
/*
* Upgrade the purple rupee reward to the heart piece if this
* is the first grand prize dig.
*/
if (!(gSaveContext.itemGetInf[1] & 0x1000)) {
gSaveContext.itemGetInf[1] |= 0x1000;
if (Flags_GetCollectible(globalCtx, 0x19) == 0) {
this->currentReward = 4;
collectibleParams = ITEM00_HEART_PIECE;
}
}
Item_DropCollectible(globalCtx, &rewardPos, rewardParams[this->currentReward]);
EnItem00* reward = Item_DropCollectible(globalCtx, &rewardPos, collectibleParams);
if (this->currentReward == 4) {
reward->collectibleFlag = 0x19;
}
}
}