mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Fix deletequick() and deletetele() not deleting their files
The problem here is that we're directly using the C stdio library, instead of using PHYSFS's stuff. So I've added a function FILESYSTEM_delete() that does exactly that.
This commit is contained in:
parent
842eb669b7
commit
2076898020
3 changed files with 11 additions and 4 deletions
|
@ -510,3 +510,8 @@ bool FILESYSTEM_openDirectory(const char *dname)
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool FILESYSTEM_delete(const char *name)
|
||||
{
|
||||
return PHYSFS_delete(name) != 0;
|
||||
}
|
||||
|
|
|
@ -23,4 +23,6 @@ std::vector<std::string> FILESYSTEM_getLevelDirFileNames();
|
|||
bool FILESYSTEM_openDirectoryEnabled();
|
||||
bool FILESYSTEM_openDirectory(const char *dname);
|
||||
|
||||
bool FILESYSTEM_delete(const char *name);
|
||||
|
||||
#endif /* FILESYSTEMUTILS_H */
|
||||
|
|
|
@ -7188,16 +7188,16 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
|
|||
|
||||
void Game::deletequick()
|
||||
{
|
||||
if( remove( "qsave.vvv" ) != 0 )
|
||||
puts("Error deleting qsave.vvv");
|
||||
if( !FILESYSTEM_delete( "saves/qsave.vvv" ) )
|
||||
puts("Error deleting saves/qsave.vvv");
|
||||
else
|
||||
quicksummary = "";
|
||||
}
|
||||
|
||||
void Game::deletetele()
|
||||
{
|
||||
if( remove( "tsave.vvv" ) != 0 )
|
||||
puts("Error deleting tsave.vvv");
|
||||
if( !FILESYSTEM_delete( "saves/tsave.vvv" ) )
|
||||
puts("Error deleting saves/tsave.vvv");
|
||||
else
|
||||
telesummary = "";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue