Fix #14081: Check if removed item is a savegame (#14371)

This commit is contained in:
Adam Zmuda 2025-06-18 10:05:18 +02:00 committed by GitHub
parent 7aa4e7fc58
commit 9238f508eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);