[wpdev-commits] wolfpack/muls maps.cpp,1.13,1.14
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-25 21:16:05
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28084/muls Modified Files: maps.cpp Log Message: fixes Index: maps.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** maps.cpp 20 Sep 2004 03:35:37 -0000 1.13 --- maps.cpp 25 Sep 2004 21:15:46 -0000 1.14 *************** *** 322,325 **** --- 322,327 ---- bool cMaps::registerMap( uint id, const QString& mapfile, uint mapwidth, uint mapheight, const QString& staticsfile, const QString& staticsidx ) { + MapsPrivate* p = 0; + try { *************** *** 335,341 **** if ( ( *it ).lower() == staticsfile.lower() ) staticsFileName = *it; } - MapsPrivate* p = new MapsPrivate( basePath + staticsIdxName, basePath + mapFileName, basePath + staticsFileName ); p->height = mapheight; p->width = mapwidth; --- 337,349 ---- if ( ( *it ).lower() == staticsfile.lower() ) staticsFileName = *it; + } + + try { + p = new MapsPrivate( basePath + staticsIdxName, basePath + mapFileName, basePath + staticsFileName ); + } catch(wpFileNotFoundException &e) { + Console::instance()->log(LOG_WARNING, QString("Unable to find the files for map %1.\n").arg(id)); + return false; } p->height = mapheight; p->width = mapwidth; *************** *** 344,347 **** --- 352,356 ---- return true; } catch ( wpFileNotFoundException& e ) { + delete p; Console::instance()->log(LOG_WARNING, e.error()); return false; |