mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8651 from Robyt3/Client-Saves-File-Header-Fix
Fix CSV header being written multiple times to `ddnet-saves.txt`
This commit is contained in:
commit
08f955bff0
|
@ -604,6 +604,7 @@ void CChat::StoreSave(const char *pText)
|
|||
}
|
||||
*/
|
||||
|
||||
const bool SavesFileExists = Storage()->FileExists(SAVES_FILE, IStorage::TYPE_SAVE);
|
||||
IOHANDLE File = Storage()->OpenFile(SAVES_FILE, IOFLAG_APPEND, IStorage::TYPE_SAVE);
|
||||
if(!File)
|
||||
return;
|
||||
|
@ -615,7 +616,7 @@ void CChat::StoreSave(const char *pText)
|
|||
aSaveCode,
|
||||
};
|
||||
|
||||
if(io_tell(File) == 0)
|
||||
if(!SavesFileExists)
|
||||
{
|
||||
CsvWrite(File, 4, SAVES_HEADER);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue