diff options
author | Mohamed Waheed <mohamedwaheedmohamed@gmail.com> | 2014-06-24 20:31:17 +0300 |
---|---|---|
committer | Mohamed Waheed <mohamedwaheedmohamed@gmail.com> | 2014-06-24 20:31:17 +0300 |
commit | f5ba2a27d4422401317d814c60048121f9804429 (patch) | |
tree | 605e015c4d76fd72e2410bc18c886f84bf7047a8 /src/app | |
parent | b7125a5b24bc6d2581bec0d3f792ba948e0e7edd (diff) | |
download | colobot-f5ba2a27d4422401317d814c60048121f9804429.tar.gz colobot-f5ba2a27d4422401317d814c60048121f9804429.tar.bz2 colobot-f5ba2a27d4422401317d814c60048121f9804429.zip |
fixed savefile screenshot loading bug
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/gamedata.cpp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/app/gamedata.cpp b/src/app/gamedata.cpp index 1bf3f36..05c0242 100644 --- a/src/app/gamedata.cpp +++ b/src/app/gamedata.cpp @@ -78,16 +78,22 @@ std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath) for(std::vector<std::string>::reverse_iterator rit = m_dataDirs.rbegin(); rit != m_dataDirs.rend(); ++rit) { std::stringstream str; - str << *rit; - str << "/"; - str << m_standardDataDirs[index]; - if (dir == DIR_HELP) - { + + if ( subpath.find("save") == std::string::npos ){ // if its NOT a path to a savefile screenshot + str << *rit; + str << "/"; + str << m_standardDataDirs[index]; + + if (dir == DIR_HELP) + { + str << "/"; + str << CApplication::GetInstancePointer()->GetLanguageChar(); + } str << "/"; - str << CApplication::GetInstancePointer()->GetLanguageChar(); } - str << "/"; + str << subpath; + boost::filesystem::path path(str.str()); if(boost::filesystem::exists(path)) { @@ -95,18 +101,9 @@ std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath) } } - std::stringstream str; - str << m_dataDirs[0]; - str << "/"; - str << m_standardDataDirs[index]; - if (dir == DIR_HELP) - { - str << "/"; - str << CApplication::GetInstancePointer()->GetLanguageChar(); - } - str << "/"; - str << subpath; - return str.str(); + GetLogger()->Error("file subpath error\n"); + + return ""; } std::string CGameData::GetDataPath(const std::string &subpath) |