WAAAOOOW when deleting save file

This commit is contained in:
Agent X 2024-07-22 12:44:25 -04:00
parent 7a9d32551c
commit a6d56efa33
2 changed files with 9 additions and 9 deletions

View File

@ -427,26 +427,24 @@ void save_file_erase(s32 fileIndex) {
save_file_do_save(fileIndex, TRUE);
}
void save_file_reload(u8 load_all) {
void save_file_reload(u8 loadAll) {
gSaveFileModified = TRUE;
update_all_mario_stars();
if (load_all == TRUE) {
if (loadAll) {
save_file_load_all(TRUE);
save_file_do_save(gCurrSaveFileNum-1, TRUE);
save_file_do_save(gCurrSaveFileNum - 1, TRUE);
update_all_mario_stars();
}
}
void save_file_erase_current_backup_save(void) {
if (INVALID_FILE_INDEX(gCurrSaveFileNum-1)) { return; }
if (network_is_server()) {
bzero(&gSaveBuffer.files[gCurrSaveFileNum-1][1], sizeof(gSaveBuffer.files[gCurrSaveFileNum-1][1]));
if (gNetworkType != NT_SERVER) { return; }
bzero(&gSaveBuffer.files[gCurrSaveFileNum - 1][1], sizeof(gSaveBuffer.files[gCurrSaveFileNum - 1][1]));
save_file_reload(FALSE);
save_file_do_save(gCurrSaveFileNum-1, TRUE);
}
save_file_do_save(gCurrSaveFileNum - 1, TRUE);
}
//! Needs to be s32 to match on -O2, despite no return value.

View File

@ -3,6 +3,7 @@
#include "djui_panel.h"
#include "djui_panel_menu.h"
#include "djui_panel_confirm.h"
#include "game/level_update.h"
#include "game/save_file.h"
#include "pc/configfile.h"
@ -76,6 +77,7 @@ static void djui_panel_host_save_button_click(struct DjuiBase* caller) {
static void djui_panel_host_save_erase_yes(struct DjuiBase* caller) {
save_file_erase(sButtonTag);
play_character_sound(gMarioState, CHAR_SOUND_WAAAOOOW);
djui_panel_host_save_update_button(sSaveButtons[sButtonTag], sButtonTag);
djui_panel_menu_back(caller);
}