Fixes double def and split second wrong colors

This commit is contained in:
aMannus 2022-08-24 22:18:24 +02:00
parent f88e7fabd5
commit d5074c3e77
2 changed files with 10 additions and 1 deletions

View File

@ -1170,7 +1170,8 @@ void Player_DrawGetItemImpl(GlobalContext* globalCtx, Player* this, Vec3f* refPo
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
if (this->getItemEntry.drawFunc != NULL && CVar_GetS32("gRandoMatchKeyColors", 0)) {
if (this->getItemEntry.drawFunc != NULL &&
(CVar_GetS32("gRandoMatchKeyColors", 0) || this->getItemEntry.getItemId == RG_DOUBLE_DEFENSE)) {
this->getItemEntry.drawFunc(globalCtx, &this->getItemEntry);
} else {
GetItem_Draw(globalCtx, drawIdPlusOne - 1);

View File

@ -12667,6 +12667,14 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) {
this->stateFlags1 &= ~PLAYER_STATE1_29;
func_80852FFC(globalCtx, NULL, 8);
}
// Set unk_862 to 0 early to not have the game draw non-custom colored models for a split second.
// This unk is what the game normally uses to decide what item to draw when holding up an item above Link's head.
// Only do this when the item actually has a custom draw function.
if (this->getItemEntry.drawFunc != NULL) {
this->unk_862 = 0;
}
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
}