Fixes vanilla ice traps and randomized ice smoke

This commit is contained in:
Christopher Leggett 2022-08-19 19:36:44 -04:00
parent 4e2707aefc
commit a67c6b9e67
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79
2 changed files with 8 additions and 4 deletions

View File

@ -19,7 +19,7 @@ typedef struct {
/* 0x03 */ uint16_t textId;
/* 0x04 */ uint16_t objectId;
/* 0x06 */ uint16_t modIndex; // 0 = Vanilla, 1 = Randomizer, future mods will increment up?
/* 0x08 */ uint16_t getItemId;
/* 0x08 */ int16_t getItemId;
/* 0x0A */ uint16_t gid; // Stores the GID value unmodified for future reference.
/* 0x0C */ uint16_t collectable; // determines whether the item can be collected on the overworld. Will be true in most cases.
} GetItemEntry; // size = 0x0F

View File

@ -481,8 +481,12 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) {
}
// Chests need to have a negative getItemId in order to not immediately give their item
// when approaching.
sItem.getItemId = 0 - sItem.getItemId;
GiveItemEntryFromActorWithFixedRange(&this->dyna.actor, globalCtx, sItem);
if (gSaveContext.n64ddFlag) {
sItem.getItemId = 0 - sItem.getItemId;
GiveItemEntryFromActorWithFixedRange(&this->dyna.actor, globalCtx, sItem);
} else {
func_8002F554(&this->dyna.actor, globalCtx, -(this->dyna.actor.params >> 5 & 0x7F));
}
}
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
EnBox_SetupAction(this, EnBox_Open);
@ -594,7 +598,7 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (((!gSaveContext.n64ddFlag && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) ||
(gSaveContext.n64ddFlag && sItem.getItemId == RG_ICE_TRAP)) &&
(gSaveContext.n64ddFlag && ABS(sItem.getItemId) == RG_ICE_TRAP)) &&
this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 &&
this->iceSmokeTimer < 100) EnBox_SpawnIceSmoke(this, globalCtx);
}