From d16396db0ac3e7b951bb69e6c2d7c5087606b09a Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 2 Apr 2012 15:17:31 +0000 Subject: [PATCH] - more save / loadgame bugfixes --- source/glest_game/main/program.cpp | 2 +- source/glest_game/types/tech_tree.cpp | 9 ++++----- source/glest_game/world/world.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index 6ad5b01d8..6f1ae9644 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -590,7 +590,7 @@ void Program::setState(ProgramState *programStateNew, bool cleanupOldState) { sprintf(szBuf,"In [%s::%s Line: %d]\nError [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,e.what()); SystemFlags::OutputDebug(SystemFlags::debugError,szBuf); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,szBuf); - abort(); + //abort(); messageBoxIsSystemError = true; diff --git a/source/glest_game/types/tech_tree.cpp b/source/glest_game/types/tech_tree.cpp index be5496f31..d14536fa6 100644 --- a/source/glest_game/types/tech_tree.cpp +++ b/source/glest_game/types/tech_tree.cpp @@ -50,13 +50,12 @@ Checksum TechTree::loadTech(const string &techName, name = ""; Checksum techtreeChecksum; string path=findPath(techName); - if(path!=""){ + if(path!="") { //printf(">>> path=%s\n",path.c_str()); load(path, factions, checksum, &techtreeChecksum, loadedFileList); } - else - { - printf(">>> schoen\n"); + else { + printf(">>> techtree [%s] path not found.\n",techName.c_str()); } return techtreeChecksum; } @@ -332,7 +331,7 @@ const ResourceType *TechTree::getFirstTechResourceType() const{ return getResourceType(i); } - throw runtime_error("This tech tree has not tech resources, one at least is required"); + throw runtime_error("This tech tree has no resources defined, at least one is required"); } const ResourceType *TechTree::getResourceType(const string &name) const{ diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index 7b335f216..2085e1b47 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -1780,7 +1780,7 @@ void World::exploreCells(const Vec2i &newPos, int sightRange, int teamIndex) { bool World::showWorldForPlayer(int factionIndex) const { bool ret = false; - if(factionIndex == thisFactionIndex) { + if(factionIndex == thisFactionIndex && game != NULL) { // Player is an Observer if(thisTeamIndex == GameConstants::maxPlayers -1 + fpt_Observer) { ret = true;