- bugfix for not finding hud for scenarios with embedded techtree

This commit is contained in:
Mark Vejvoda
2012-01-04 04:10:11 +00:00
parent a20b848646
commit a1a0b9e79c
2 changed files with 4 additions and 3 deletions

View File

@@ -521,7 +521,8 @@ void Game::loadHudTexture(const GameSettings *settings)
{
string factionName = "";
string techName = settings->getTech();
string scenarioDir =settings->getScenarioDir();
string scenarioDir = extractDirectoryPathFromFile(settings->getScenarioDir());
//printf("In loadHudTexture, scenarioDir [%s]\n",scenarioDir.c_str());
for(int i=0; i < settings->getFactionCount(); ++i ) {
if(settings->getFactionControl(i) == ctHuman){
@@ -529,7 +530,7 @@ void Game::loadHudTexture(const GameSettings *settings)
break;
}
}
if(factionName != ""){
if(factionName != "") {
Config &config= Config::getInstance();
vector<string> pathList= config.getPathListForType(ptTechs, scenarioDir);
for(int idx= 0; idx < pathList.size(); idx++){

View File

@@ -78,7 +78,7 @@ TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) {
delete ftFont; ftFont = NULL;
free((void*)fontFile);
fontFile = NULL;
throw runtime_error("FTGL: error loading font");
throw runtime_error(string("FTGL: error loading font: ") + string(fontFile));
}
free((void*)fontFile);
fontFile = NULL;