mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
prevent map editor from crashing if loaded map is invalid
This commit is contained in:
parent
fd5fe8b6ae
commit
ee9a8ce4b7
|
@ -711,6 +711,11 @@ void CEditor::CallbackOpenMap(const char *pFileName, int StorageType, void *pUse
|
||||||
pEditor->m_Dialog = DIALOG_NONE;
|
pEditor->m_Dialog = DIALOG_NONE;
|
||||||
pEditor->m_Map.m_Modified = false;
|
pEditor->m_Map.m_Modified = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEditor->Reset();
|
||||||
|
pEditor->m_aFileName[0] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void CEditor::CallbackAppendMap(const char *pFileName, int StorageType, void *pUser)
|
void CEditor::CallbackAppendMap(const char *pFileName, int StorageType, void *pUser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -435,6 +435,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
||||||
editor->reset();
|
editor->reset();
|
||||||
editor_load_old(df, this);
|
editor_load_old(df, this);
|
||||||
*/
|
*/
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else if(pItem->m_Version == 1)
|
else if(pItem->m_Version == 1)
|
||||||
{
|
{
|
||||||
|
@ -650,6 +651,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue