mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-12 11:12:20 -05:00
Fix some situations where trade items spoiled (#4569)
* Fix some situations where trade items reverted * Update z_game_over.c * Hopefully fix mac
This commit is contained in:
parent
5b7b38f198
commit
a92c08dea1
@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
void GameOver_Init(PlayState* play) {
|
||||
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||
@ -34,7 +36,7 @@ void GameOver_Update(PlayState* play) {
|
||||
gSaveContext.eventInf[1] &= ~1;
|
||||
|
||||
// search inventory for spoiling items and revert if necessary
|
||||
if (!(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE))) {
|
||||
if (GameInteractor_Should(VB_REVERT_SPOILING_ITEMS, true)) {
|
||||
for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) {
|
||||
if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[i]) {
|
||||
INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i];
|
||||
|
@ -5685,17 +5685,19 @@ void Interface_Draw(PlayState* play) {
|
||||
}
|
||||
|
||||
// Revert any spoiling trade quest items
|
||||
for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) {
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) {
|
||||
gSaveContext.eventInf[0] &= 0x7F80;
|
||||
osSyncPrintf("EVENT_INF=%x\n", gSaveContext.eventInf[0]);
|
||||
play->nextEntranceIndex = spoilingItemEntrances[svar1];
|
||||
INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1];
|
||||
if (GameInteractor_Should(VB_REVERT_SPOILING_ITEMS, true)) {
|
||||
for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) {
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) {
|
||||
gSaveContext.eventInf[0] &= 0x7F80;
|
||||
osSyncPrintf("EVENT_INF=%x\n", gSaveContext.eventInf[0]);
|
||||
play->nextEntranceIndex = spoilingItemEntrances[svar1];
|
||||
INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1];
|
||||
|
||||
for (svar2 = 1; svar2 < ARRAY_COUNT(gSaveContext.equips.buttonItems); svar2++) {
|
||||
if (gSaveContext.equips.buttonItems[svar2] == gSpoilingItems[svar1]) {
|
||||
gSaveContext.equips.buttonItems[svar2] = gSpoilingItemReverts[svar1];
|
||||
Interface_LoadItemIcon1(play, svar2);
|
||||
for (svar2 = 1; svar2 < ARRAY_COUNT(gSaveContext.equips.buttonItems); svar2++) {
|
||||
if (gSaveContext.equips.buttonItems[svar2] == gSpoilingItems[svar1]) {
|
||||
gSaveContext.equips.buttonItems[svar2] = gSpoilingItemReverts[svar1];
|
||||
Interface_LoadItemIcon1(play, svar2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user