Merge pull request #1292 from aMannus/custom-key-colors-fix

Rando: Custom key colors fix
This commit is contained in:
briaguya 2022-08-24 17:17:54 -04:00 committed by GitHub
commit f15b3880f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -1170,7 +1170,9 @@ 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)) {
// RANDOTODO: Make this more flexible for easier toggling of individual item recolors in the future.
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;
}