Fix datafile building before the file is open

This commit is contained in:
heinrich5991 2015-08-27 00:36:10 +02:00
parent 53d7e0dd4c
commit a945cca8a5
2 changed files with 1 additions and 5 deletions

View file

@ -482,8 +482,6 @@ bool CDataFileWriter::Open(class IStorage *pStorage, const char *pFilename)
int CDataFileWriter::AddItem(int Type, int ID, int Size, void *pData)
{
if(!m_File) return 0;
dbg_assert(Type >= 0 && Type < 0xFFFF, "incorrect type");
dbg_assert(m_NumItems < 1024, "too many items");
dbg_assert(Size%sizeof(int) == 0, "incorrect boundary");
@ -518,8 +516,6 @@ int CDataFileWriter::AddItem(int Type, int ID, int Size, void *pData)
int CDataFileWriter::AddData(int Size, void *pData)
{
if(!m_File) return 0;
dbg_assert(m_NumDatas < 1024, "too much data");
CDataInfo *pInfo = &m_pDatas[m_NumDatas];

View file

@ -108,7 +108,7 @@ void Process(IStorage *pStorage, const char *pMapName, const char *pConfigName)
}
Reader.Close();
if(!Writer.Open(pStorage, pMapName))
if(!Writer.OpenFile(pStorage, pMapName))
{
dbg_msg("config_store", "couldn't open map file '%s' for writing", pMapName);
return;