1
0
forked from 0ad/0ad

# Fixed saving over archived files

This was SVN commit r3837.
This commit is contained in:
Ykkrosh 2006-05-04 02:56:06 +00:00
parent 9e74e3a077
commit 66b898dca5
3 changed files with 5 additions and 2 deletions

View File

@ -156,7 +156,7 @@ void CMapWriter::PackTerrain(CFilePacker& packer, CTerrain *pTerrain)
void CMapWriter::WriteXML(const char* filename, CUnitManager* pUnitMan, CLightEnv *pLightEnv, CCamera *pCamera)
{
Handle h = vfs_open(filename, FILE_WRITE|FILE_NO_AIO);
Handle h = vfs_open(filename, FILE_WRITE_TO_MOD|FILE_NO_AIO);
if (h <= 0)
{
debug_warn("Failed to open map XML file");

View File

@ -34,7 +34,7 @@ CFilePacker::CFilePacker(u32 version, const char magicstr[4])
void CFilePacker::Write(const char* filename)
{
// write out all data (including header)
if(vfs_store(filename, &m_Data[0], m_Data.size(), FILE_NO_AIO) < 0)
if(vfs_store(filename, &m_Data[0], m_Data.size(), FILE_NO_AIO|FILE_WRITE_TO_MOD) < 0)
throw PSERROR_File_WriteFailed();
}

View File

@ -573,6 +573,9 @@ static void InitVfs(const char* argv0)
vfs_mount("screenshots/", "screenshots");
vfs_mount("profiles/", "profiles", VFS_MOUNT_RECURSIVE);
// TODO: once people can load multiple mods, set the top one to be the write target
vfs_mod_set_write_target("mods/official");
// don't try vfs_display yet: SDL_Init hasn't yet redirected stdout
}