Autosave when quitting game (moronimo)
This commit is contained in:
parent
cc75c6ef03
commit
722d249916
1 changed files with 13 additions and 5 deletions
|
|
@ -505,11 +505,18 @@ static void State_autosave(void) {
|
|||
state_slot = last_state_slot;
|
||||
}
|
||||
static void State_resume(void) {
|
||||
if (!exists(RESUME_SLOT_PATH)) return;
|
||||
|
||||
int last_state_slot = state_slot;
|
||||
|
||||
if (exists(RESUME_SLOT_PATH)) {
|
||||
state_slot = getInt(RESUME_SLOT_PATH);
|
||||
unlink(RESUME_SLOT_PATH);
|
||||
if( state_slot == 8 ) {
|
||||
state_slot = AUTO_RESUME_SLOT;
|
||||
}
|
||||
} else {
|
||||
state_slot = AUTO_RESUME_SLOT;
|
||||
}
|
||||
|
||||
State_read();
|
||||
state_slot = last_state_slot;
|
||||
}
|
||||
|
|
@ -4357,6 +4364,7 @@ int main(int argc , char* argv[]) {
|
|||
Menu_quit();
|
||||
|
||||
finish:
|
||||
State_autosave();
|
||||
|
||||
Game_close();
|
||||
Core_unload();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue