mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 13:00:11 -07:00
Don't autosave immediately after purchasing from a shop (#2079)
This commit is contained in:
parent
8c23bcd67c
commit
26ec69606a
11 changed files with 71 additions and 25 deletions
|
@ -2715,8 +2715,9 @@ u8 Item_CheckObtainability(u8 item) {
|
|||
return gSaveContext.inventory.items[slot];
|
||||
}
|
||||
|
||||
// Save when receiving an item, unless it's purchased from a shop
|
||||
void PerformAutosave(PlayState* play, u8 item) {
|
||||
if (CVar_GetS32("gAutosave", 0) && (play && play->sceneNum != SCENE_KENJYANOMA)) {
|
||||
if (CVar_GetS32("gAutosave", 0) && (play != NULL) && (play->sceneNum != SCENE_KENJYANOMA) && (gSaveContext.pendingSale == ITEM_NONE)) {
|
||||
if (CVar_GetS32("gAutosaveAllItems", 0)) {
|
||||
Play_PerformSave(play);
|
||||
} else if (CVar_GetS32("gAutosaveMajorItems", 1)) {
|
||||
|
@ -6301,6 +6302,11 @@ void Interface_Update(PlayState* play) {
|
|||
gSaveContext.rupees--;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
if (gSaveContext.rupeeAccumulator == 0) {
|
||||
u16 tempSaleItem = gSaveContext.pendingSale;
|
||||
gSaveContext.pendingSale = ITEM_NONE;
|
||||
PerformAutosave(play, tempSaleItem);
|
||||
}
|
||||
} else {
|
||||
gSaveContext.rupeeAccumulator = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue