From f339cc8431c0a7b6a4d514599e6fa57a75eb6495 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Fri, 20 Nov 2015 19:34:09 +0000 Subject: Member variable unused so removed it. Leaves one asking *why* the datapath can be inside the game directory. --- src/shared/gameinfo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/shared/gameinfo.cpp') diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index e5e47cdf..703f4a40 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -40,8 +40,8 @@ namespace MOShared { GameInfo* GameInfo::s_Instance = nullptr; -GameInfo::GameInfo(const std::wstring &moDataDirectory, const std::wstring &gameDirectory) - : m_GameDirectory(gameDirectory), m_OrganizerDataDirectory(moDataDirectory) +GameInfo::GameInfo(const std::wstring &gameDirectory) + : m_GameDirectory(gameDirectory) { atexit(&cleanup); } @@ -87,36 +87,36 @@ void GameInfo::identifyMyGamesDirectory(const std::wstring &file) } -bool GameInfo::identifyGame(const std::wstring &moDataDirectory, const std::wstring &searchPath) +bool GameInfo::identifyGame(const std::wstring &searchPath) { if (OblivionInfo::identifyGame(searchPath)) { - s_Instance = new OblivionInfo(moDataDirectory, searchPath); + s_Instance = new OblivionInfo(searchPath); } else if (Fallout3Info::identifyGame(searchPath)) { - s_Instance = new Fallout3Info(moDataDirectory, searchPath); + s_Instance = new Fallout3Info(searchPath); } else if (FalloutNVInfo::identifyGame(searchPath)) { - s_Instance = new FalloutNVInfo(moDataDirectory, searchPath); + s_Instance = new FalloutNVInfo(searchPath); } else if (SkyrimInfo::identifyGame(searchPath)) { - s_Instance = new SkyrimInfo(moDataDirectory, searchPath); + s_Instance = new SkyrimInfo(searchPath); } return s_Instance != nullptr; } -bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gamePath) +bool GameInfo::init(const std::wstring &moDirectory, const std::wstring &gamePath) { if (s_Instance == nullptr) { if (gamePath.length() == 0) { // search upward in the directory until a recognized game-binary is found std::wstring searchPath(moDirectory); - while (!identifyGame(moDataDirectory, searchPath)) { + while (!identifyGame(searchPath)) { size_t lastSep = searchPath.find_last_of(L"/\\"); if (lastSep == std::string::npos) { return false; } searchPath.erase(lastSep); } - } else if (!identifyGame(moDataDirectory, gamePath)) { + } else if (!identifyGame(gamePath)) { return false; } } -- cgit v1.3.1