mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
fix for bug 1672
This commit is contained in:
parent
9197d4b653
commit
ea2feb0aa9
1 changed files with 10 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "document.hpp"
|
#include "document.hpp"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
|
@ -2218,16 +2219,18 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
|
||||||
|
|
||||||
if (!boost::filesystem::exists (mProjectPath))
|
if (!boost::filesystem::exists (mProjectPath))
|
||||||
{
|
{
|
||||||
boost::filesystem::path locCustomFiltersPath (configuration.getUserDataPath());
|
boost::filesystem::path customFiltersPath (configuration.getUserDataPath());
|
||||||
locCustomFiltersPath /= "defaultfilters";
|
customFiltersPath /= "defaultfilters";
|
||||||
|
|
||||||
if (boost::filesystem::exists (locCustomFiltersPath))
|
std::string destinationPath = mProjectPath.string() + "/defaultfilters";
|
||||||
|
std::ofstream dst(destinationPath.c_str(), std::ios::binary);
|
||||||
|
|
||||||
|
if (boost::filesystem::exists (customFiltersPath))
|
||||||
{
|
{
|
||||||
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
dst<<std::ifstream(customFiltersPath.c_str(), std::ios::binary).rdbuf();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
boost::filesystem::copy_file (mResDir / "defaultfilters", mProjectPath);
|
dst<<std::ifstream(std::string(mResDir.string() + "/defaultfilters").c_str(), std::ios::binary).rdbuf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue