mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
Automatically save after every scene transition (#984)
* Automatically save after every scene transition * Refactor and don't save in grottos * Don't save in cutscenes * Save after getting items as well * Fix paren
This commit is contained in:
parent
2f5f089e7f
commit
c23457d666
5 changed files with 75 additions and 13 deletions
|
@ -698,6 +698,11 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
}
|
||||
|
||||
// Don't autosave in grottos or cutscenes
|
||||
if (CVar_GetS32("gAutosave", 0) && (globalCtx->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (globalCtx->sceneNum != SCENE_KAKUSIANA) && (gSaveContext.cutsceneIndex == 0)) {
|
||||
Gameplay_PerformSave(globalCtx);
|
||||
}
|
||||
}
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
} else {
|
||||
|
@ -1972,3 +1977,19 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Gameplay_PerformSave(GlobalContext* globalCtx) {
|
||||
Gameplay_SaveSceneFlags(globalCtx);
|
||||
gSaveContext.savedSceneNum = globalCtx->sceneNum;
|
||||
if (gSaveContext.temporaryWeapon) {
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
||||
GET_PLAYER(globalCtx)->currentSwordItem = ITEM_NONE;
|
||||
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
|
||||
Save_SaveFile();
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
|
||||
GET_PLAYER(globalCtx)->currentSwordItem = ITEM_SWORD_KOKIRI;
|
||||
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI);
|
||||
} else {
|
||||
Save_SaveFile();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue