diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 8860e9a7..49722518 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -578,8 +578,20 @@ string Game::extractFactionLogoFile(bool &loadingImageUsed, string factionName, //printf("D factionXMLFile [%s] linkedTechTreeName [%s]\n",factionXMLFile.c_str(),linkedTechTreeName.c_str()); if(linkedTechTreeName != "") { - path = currentPath + linkedTechTreeName + "/" + "factions" + "/" + factionName; + + string linkedTechTreePath=TechTree::findPath(linkedTechTreeName,pathList); + string techTreePath=linkedTechTreePath; + endPathWithSlash(techTreePath); + + string linkedCurrentPath = techTreePath + "factions/" + factionName; + endPathWithSlash(linkedCurrentPath); + string linkedTmppath= linkedCurrentPath + factionName +".xml"; + + path = linkedCurrentPath; if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] possible loading screen dir '%s'\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,path.c_str()); + + //printf("D1 idx = %d\ncurrentPath [%s]\npath [%s]\npathList[idx] [%s]\n",idx,currentPath.c_str(),path.c_str(),pathList[idx].c_str()); + if(isdir(path.c_str()) == true) { endPathWithSlash(path); diff --git a/source/glest_game/types/tech_tree.cpp b/source/glest_game/types/tech_tree.cpp index 3052c401..e098d846 100644 --- a/source/glest_game/types/tech_tree.cpp +++ b/source/glest_game/types/tech_tree.cpp @@ -60,9 +60,12 @@ Checksum TechTree::loadTech(const string &techName, return techtreeChecksum; } -string TechTree::findPath(const string &techName) const{ - for(int idx = 0; idx < pathList.size(); idx++) { - string currentPath = (pathList)[idx]; +string TechTree::findPath(const string &techName) const { + return findPath(techName,pathList); +} +string TechTree::findPath(const string &techName, const vector &pathTechList) { + for(unsigned int idx = 0; idx < pathTechList.size(); ++idx) { + string currentPath = (pathTechList)[idx]; endPathWithSlash(currentPath); string path = currentPath + techName; diff --git a/source/glest_game/types/tech_tree.h b/source/glest_game/types/tech_tree.h index 3dcb242c..e9f7674e 100644 --- a/source/glest_game/types/tech_tree.h +++ b/source/glest_game/types/tech_tree.h @@ -59,6 +59,7 @@ public: void load(const string &dir, set &factions, Checksum* checksum, Checksum *techtreeChecksum, std::map > > &loadedFileList); string findPath(const string &techName) const; + static string findPath(const string &techName, const vector &pathTechList); TechTree(const vector pathList); ~TechTree();