mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Simplifies logic for whether or not to spawn heart piece
This commit is contained in:
parent
b33a66c408
commit
ead13423b3
1 changed files with 6 additions and 6 deletions
|
@ -606,17 +606,17 @@ 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
|
||||
* is the first grand prize dig.
|
||||
*/
|
||||
// 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) {
|
||||
// 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)) {
|
||||
this->currentReward = 4;
|
||||
gSaveContext.itemGetInf[1] |= 0x1000;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue