- attempt to fix pizza's crash

This commit is contained in:
Mark Vejvoda 2012-07-20 22:18:34 +00:00
parent 2204e0577c
commit c42d44a53a
2 changed files with 8 additions and 5 deletions

View File

@ -919,8 +919,8 @@ void Game::init(bool initForPreviewOnly) {
world.init(this, gameSettings.getDefaultUnits());
}
catch(const exception &ex) {
char szBuf[4096]="";
sprintf(szBuf,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
char szBuf[8096]="";
sprintf(szBuf,"In [%s::%s Line: %d]\nError [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,szBuf);

View File

@ -262,14 +262,17 @@ void World::init(Game *game, bool createUnits, bool initFactions){
char szErrBuf[8096]="";
try {
if(createUnits){
if(createUnits) {
initUnits();
}
}
catch(const std::exception &ex) {
//printf("***A\n");
gotError = true;
sprintf(szErrBuf,"In [%s::%s %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
sprintf(szErrBuf,"In [%s::%s %d]\nerror [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
SystemFlags::OutputDebug(SystemFlags::debugError,szErrBuf);
//printf("***B\n");
}
if(loadWorldNode != NULL) {
@ -1676,7 +1679,7 @@ void World::initUnits() {
}
catch(const std::exception &ex) {
gotError = true;
sprintf(szErrBuf,"In [%s::%s %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
sprintf(szErrBuf,"In [%s::%s %d]\nerror [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
SystemFlags::OutputDebug(SystemFlags::debugError,szErrBuf);
}