From a6d56efa333569bf7f8b631ba350f0267c6e2957 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:44:25 -0400 Subject: [PATCH] WAAAOOOW when deleting save file --- src/game/save_file.c | 16 +++++++--------- src/pc/djui/djui_panel_host_save.c | 2 ++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/save_file.c b/src/game/save_file.c index 635394c4..7fcc0689 100644 --- a/src/game/save_file.c +++ b/src/game/save_file.c @@ -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; } - save_file_reload(FALSE); - - save_file_do_save(gCurrSaveFileNum-1, TRUE); - } + bzero(&gSaveBuffer.files[gCurrSaveFileNum - 1][1], sizeof(gSaveBuffer.files[gCurrSaveFileNum - 1][1])); + save_file_reload(FALSE); + save_file_do_save(gCurrSaveFileNum - 1, TRUE); } //! Needs to be s32 to match on -O2, despite no return value. diff --git a/src/pc/djui/djui_panel_host_save.c b/src/pc/djui/djui_panel_host_save.c index 63f1862a..1bd01115 100644 --- a/src/pc/djui/djui_panel_host_save.c +++ b/src/pc/djui/djui_panel_host_save.c @@ -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); }