mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Replaces TempClear flag with local variable
This commit is contained in:
parent
6dc5b05eaf
commit
f18a31b974
1 changed files with 5 additions and 2 deletions
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3)
|
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3)
|
||||||
|
|
||||||
|
bool heartPieceSpawned;
|
||||||
|
|
||||||
void EnTk_Init(Actor* thisx, GlobalContext* globalCtx);
|
void EnTk_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void EnTk_Update(Actor* thisx, GlobalContext* globalCtx);
|
void EnTk_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||||
|
@ -505,6 +507,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
this->currentReward = -1;
|
this->currentReward = -1;
|
||||||
this->currentSpot = NULL;
|
this->currentSpot = NULL;
|
||||||
this->actionFunc = EnTk_Rest;
|
this->actionFunc = EnTk_Rest;
|
||||||
|
heartPieceSpawned = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
@ -614,13 +617,13 @@ 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.
|
// 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.
|
// Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true.
|
||||||
// If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag.
|
// If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag.
|
||||||
if (!Flags_GetTempClear(globalCtx, TEMPCLEARFLAG_GRAVEDIGGING_HEART_PIECE) &&
|
if (!heartPieceSpawned &&
|
||||||
(!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) ||
|
(!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) ||
|
||||||
CVar_GetS32("gGravediggingTourFix", 0) &&
|
CVar_GetS32("gGravediggingTourFix", 0) &&
|
||||||
!Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) {
|
!Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) {
|
||||||
this->currentReward = 4;
|
this->currentReward = 4;
|
||||||
gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE;
|
gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE;
|
||||||
Flags_SetTempClear(globalCtx, TEMPCLEARFLAG_GRAVEDIGGING_HEART_PIECE);
|
heartPieceSpawned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue