summaryrefslogtreecommitdiff
path: root/src/shared/skyriminfo.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-03-22 18:57:45 +0100
committerTannin <devnull@localhost>2013-03-22 18:57:45 +0100
commitec0ea9df8dabe686d3256665c7ed638660309915 (patch)
tree39ff86ad325494c3531c159990ee695e84bee469 /src/shared/skyriminfo.cpp
parent24cc3861912cc33235af587d4f4feb538c1054dc (diff)
parent74c75e60d67b66a63225239c1f6b1403662857aa (diff)
Merge with default
Diffstat (limited to 'src/shared/skyriminfo.cpp')
-rw-r--r--src/shared/skyriminfo.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp
index 6302cef3..1c13effb 100644
--- a/src/shared/skyriminfo.cpp
+++ b/src/shared/skyriminfo.cpp
@@ -27,6 +27,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "error_report.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
+#include <Shlwapi.h>
#include <boost/assign.hpp>
namespace MOShared {
@@ -36,6 +37,11 @@ SkyrimInfo::SkyrimInfo(const std::wstring &omoDirectory, const std::wstring &gam
: GameInfo(omoDirectory, gameDirectory)
{
identifyMyGamesDirectory(L"skyrim");
+
+ wchar_t appDataPath[MAX_PATH];
+ if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appDataPath))) {
+ m_AppData = appDataPath;
+ }
}
bool SkyrimInfo::identifyGame(const std::wstring &searchPath)
@@ -259,7 +265,7 @@ bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPa
}
if ((_wcsicmp(fileName, L"plugins.txt") == 0) &&
- (wcsstr(fullPath, L"AppData") != NULL)){
+ (m_AppData.empty() || (StrStrIW(fullPath, m_AppData.c_str()) != NULL))) {
return true;
}