Codechange: Introduce FioRemove() to remove files. (#12491)
New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
This commit is contained in:
@@ -523,7 +523,7 @@ DEF_CONSOLE_CMD(ConRemove)
|
||||
_console_file_list_savegame.ValidateFileList();
|
||||
const FiosItem *item = _console_file_list_savegame.FindItem(file);
|
||||
if (item != nullptr) {
|
||||
if (unlink(item->name.c_str()) != 0) {
|
||||
if (!FioRemove(item->name)) {
|
||||
IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user