mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix temp file creation in case no temp file is needed
This commit is contained in:
parent
628a10bcaa
commit
d56f80f0f5
|
@ -2571,7 +2571,7 @@ void CGameContext::OnMapChange(char *pNewMapName, int MapNameSize)
|
|||
Reader.Open(pStorage, pNewMapName, IStorage::TYPE_ALL);
|
||||
|
||||
CDataFileWriter Writer;
|
||||
Writer.Open(pStorage, aTemp);
|
||||
Writer.Init();
|
||||
|
||||
int SettingsIndex = Reader.NumData();
|
||||
for(int i = 0; i < Reader.NumItems(); i++)
|
||||
|
@ -2633,6 +2633,7 @@ void CGameContext::OnMapChange(char *pNewMapName, int MapNameSize)
|
|||
|
||||
dbg_msg("mapchange", "imported settings");
|
||||
Reader.Close();
|
||||
Writer.OpenFile(pStorage, aTemp);
|
||||
Writer.Finish();
|
||||
|
||||
str_copy(pNewMapName, aTemp, MapNameSize);
|
||||
|
|
Loading…
Reference in a new issue