mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-13 11:42:19 -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 "global.h"
|
||||||
#include "soh/OTRGlobals.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) {
|
void GameOver_Init(PlayState* play) {
|
||||||
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||||
@ -34,7 +36,7 @@ void GameOver_Update(PlayState* play) {
|
|||||||
gSaveContext.eventInf[1] &= ~1;
|
gSaveContext.eventInf[1] &= ~1;
|
||||||
|
|
||||||
// search inventory for spoiling items and revert if necessary
|
// 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++) {
|
for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) {
|
||||||
if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[i]) {
|
if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[i]) {
|
||||||
INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i];
|
INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i];
|
||||||
|
@ -5685,6 +5685,7 @@ void Interface_Draw(PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Revert any spoiling trade quest items
|
// Revert any spoiling trade quest items
|
||||||
|
if (GameInteractor_Should(VB_REVERT_SPOILING_ITEMS, true)) {
|
||||||
for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) {
|
for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) {
|
||||||
if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) {
|
if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) {
|
||||||
gSaveContext.eventInf[0] &= 0x7F80;
|
gSaveContext.eventInf[0] &= 0x7F80;
|
||||||
@ -5701,6 +5702,7 @@ void Interface_Draw(PlayState* play) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
|
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
|
||||||
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user