Correctly renders freestanding items

Particle effects are probably broken, need to fix them still, I pretty
much know how I would do that.
This commit is contained in:
Christopher Leggett 2022-08-06 23:29:28 -04:00
parent cfce0eba3d
commit 3258fc5fb3
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79
2 changed files with 11 additions and 3 deletions

View File

@ -1318,11 +1318,13 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f; f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
} }
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); GetItem_Draw(globalCtx, randoGetItemEntry.gi);
} else { } else {
s32 texIndex = this->actor.params - 3; s32 texIndex = this->actor.params - 3;
@ -1379,11 +1381,13 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f; f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
} }
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); GetItem_Draw(globalCtx, ABS(randoGetItemEntry.gi - 1));
} else { } else {
s32 pad; s32 pad;

View File

@ -5041,7 +5041,11 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) {
func_80835DE4(globalCtx, this, func_8084F104, 0); func_80835DE4(globalCtx, this, func_8084F104, 0);
if (sp2C >= 0) { if (sp2C >= 0) {
if (this->getItemEntry.objectId == OBJECT_INVALID) {
giEntry = ItemTable_Retrieve(D_80854528[sp2C] - 1); giEntry = ItemTable_Retrieve(D_80854528[sp2C] - 1);
} else {
giEntry = this->getItemEntry;
}
func_8083AE40(this, giEntry.objectId); func_8083AE40(this, giEntry.objectId);
} }