1
0
Fork 0

Fix #14081: Check if removed item is a savegame

pull/14371/head
kojonek2 2025-06-17 18:08:54 +02:00
parent 4144865c73
commit 404adf3495
1 changed files with 6 additions and 2 deletions

View File

@ -543,8 +543,12 @@ static bool ConRemove(std::span<std::string_view> argv)
_console_file_list_savegame.ValidateFileList();
const FiosItem *item = _console_file_list_savegame.FindItem(file);
if (item != nullptr) {
if (!FioRemove(item->name)) {
IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name);
if (item->type.abstract == FT_SAVEGAME) {
if (!FioRemove(item->name)) {
IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name);
}
} else {
IConsolePrint(CC_ERROR, "'{}' is not a savegame.", file);
}
} else {
IConsolePrint(CC_ERROR, "'{}' could not be found.", file);