mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
AGS: Fix regression when trying to delete files
This for examples fixes deleting savegames from the ingame save dialog in QfG2 AGDI. The issue is that the file name we get from get_save_game_path(int) in DeleteSaveSlot(int) contains the "/saves/" prefix, so we cannot directly pass it to the ScummVM savefile manager.
This commit is contained in:
parent
edaabb3d9d
commit
30764bbc41
@ -73,10 +73,10 @@ int File_Delete(const char *fnmm) {
|
||||
if (!ResolveScriptPath(fnmm, false, rp))
|
||||
return 0;
|
||||
|
||||
if (::remove(rp.FullPath.GetCStr()) == 0)
|
||||
if (File::DeleteFile(rp.FullPath))
|
||||
return 1;
|
||||
if (_G(errnum) == AL_ENOENT && !rp.AltPath.IsEmpty() && rp.AltPath.Compare(rp.FullPath) != 0)
|
||||
return ::remove(rp.AltPath.GetCStr()) == 0 ? 1 : 0;
|
||||
return File::DeleteFile(rp.AltPath) ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -111,8 +111,7 @@ void RestoreGameSlot(int slnum) {
|
||||
void DeleteSaveSlot(int slnum) {
|
||||
String nametouse;
|
||||
nametouse = get_save_game_path(slnum);
|
||||
|
||||
g_system->getSavefileManager()->removeSavefile(nametouse);
|
||||
Shared::File::DeleteFile(nametouse);
|
||||
}
|
||||
|
||||
void PauseGame() {
|
||||
|
Loading…
Reference in New Issue
Block a user