From 4e4825d7525e8f2cfdd5a018ff65e089ac11b866 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 29 Jun 2011 06:42:49 +0000 Subject: [PATCH] - slight change in loading factiontype (load by folder names not *. to avoid errors when garbage files exist) --- source/glest_game/types/faction_type.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/glest_game/types/faction_type.cpp b/source/glest_game/types/faction_type.cpp index 69f6db1a..3307e53a 100644 --- a/source/glest_game/types/faction_type.cpp +++ b/source/glest_game/types/faction_type.cpp @@ -56,9 +56,12 @@ void FactionType::load(const string &dir, const TechTree *techTree, Checksum* ch if(personalityType == fpt_Normal) { // a1) preload units - string unitsPath= currentPath + "units/*."; + //string unitsPath= currentPath + "units/*."; + string unitsPath= currentPath + "units/"; vector unitFilenames; - findAll(unitsPath, unitFilenames); + //findAll(unitsPath, unitFilenames); + findDirs(unitsPath, unitFilenames,false,false); + unitTypes.resize(unitFilenames.size()); for(int i = 0; i < unitTypes.size(); ++i) { @@ -69,9 +72,12 @@ void FactionType::load(const string &dir, const TechTree *techTree, Checksum* ch } // a2) preload upgrades - string upgradesPath= currentPath + "upgrades/*."; + //string upgradesPath= currentPath + "upgrades/*."; + string upgradesPath= currentPath + "upgrades/"; vector upgradeFilenames; - findAll(upgradesPath, upgradeFilenames, false, false); + //findAll(upgradesPath, upgradeFilenames, false, false); + findDirs(upgradesPath, upgradeFilenames,false,false); + upgradeTypes.resize(upgradeFilenames.size()); for(int i = 0; i < upgradeTypes.size(); ++i) { string str= currentPath + "upgrades/" + upgradeFilenames[i];