mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 04:50:05 -07:00
Fixes buying songs crash on Switch (#2899)
This commit is contained in:
parent
30cc61abce
commit
4d02d89e03
4 changed files with 48 additions and 35 deletions
|
@ -15,6 +15,7 @@
|
|||
#endif
|
||||
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
|
||||
#define DO_ACTION_TEX_WIDTH() 48
|
||||
|
@ -1706,7 +1707,7 @@ u8 Return_Item_Entry(GetItemEntry itemEntry, ItemID returnItem ) {
|
|||
|
||||
// Processes Item_Give returns
|
||||
u8 Return_Item(u8 itemID, ModIndex modId, ItemID returnItem) {
|
||||
uint32_t get = GetGIID(itemID);
|
||||
int32_t get = GetGIID(itemID);
|
||||
if (get == -1) {
|
||||
modId = MOD_RANDOMIZER;
|
||||
get = itemID;
|
||||
|
@ -6158,8 +6159,13 @@ void Interface_Update(PlayState* play) {
|
|||
u16 tempSaleMod = gSaveContext.pendingSaleMod;
|
||||
gSaveContext.pendingSale = ITEM_NONE;
|
||||
gSaveContext.pendingSaleMod = MOD_NONE;
|
||||
if (tempSaleMod == 0) {
|
||||
tempSaleItem = GetGIID(tempSaleItem);
|
||||
if (tempSaleMod == MOD_NONE) {
|
||||
s16 giid = GetGIID(tempSaleItem);
|
||||
if (giid == -1) {
|
||||
tempSaleMod = MOD_RANDOMIZER;
|
||||
} else {
|
||||
tempSaleItem = giid;
|
||||
}
|
||||
}
|
||||
GameInteractor_ExecuteOnSaleEndHooks(ItemTable_RetrieveEntry(tempSaleMod, tempSaleItem));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue