mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Adds TempClear flag set and check for heart piece.
This originally introduced a bug where the player could spawn multiple heart pieces by simply not collecting the one that spawns and continuing to dig up spots. This fixes that by checking a temp clear flag before spawning the heart piece and setting it when the heart piece spawns. Since this is a temp clear flag it will not stay set if the player exits the scene, so this still does fix the bug of locking the player out of the heart piece when spawning it and leaving without picking it up. As far as I can tell this temp clear flag isn't used anywhere else in this scene. The only one used in this scene I could find is that killing the first Poe in this scene sets flag 0x02 (or maybe it's 0x01, not sure if the flags start at 1 or 0).
This commit is contained in:
parent
ead13423b3
commit
a4c783311a
1 changed files with 4 additions and 3 deletions
|
@ -606,7 +606,6 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
|||
rewardPos.z += this->actor.world.pos.z;
|
||||
|
||||
this->currentReward = EnTk_ChooseReward(this);
|
||||
this->currentReward = 3;
|
||||
if (this->currentReward == 3) {
|
||||
/*
|
||||
* Upgrade the purple rupee reward to the heart piece if this
|
||||
|
@ -615,10 +614,12 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
|||
// If vanilla itemGetInf flag is not set, it's impossible for the new flag to be set, so return true.
|
||||
// Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true.
|
||||
// If true, spawn the heart piece isntead of the purple rupee and set the vanilla itemGetInf flag.
|
||||
if (!(gSaveContext.itemGetInf[1] & 0x1000)
|
||||
|| CVar_GetS32("gGravediggingTourFix", 0) && !Flags_GetCollectible(globalCtx, 0x19)) {
|
||||
if (!Flags_GetTempClear(globalCtx, 0x1f) &&
|
||||
(!(gSaveContext.itemGetInf[1] & 0x1000) ||
|
||||
CVar_GetS32("gGravediggingTourFix", 0) && !Flags_GetCollectible(globalCtx, 0x19))) {
|
||||
this->currentReward = 4;
|
||||
gSaveContext.itemGetInf[1] |= 0x1000;
|
||||
Flags_SetTempClear(globalCtx, 0x1f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue