if (mapvers >= 7) {
int numhotspots;
funpackf(tfile, "Bi", &numhotspots);
+ if (numhotspots < 0) {
+ cerr << "Map " << name << " have an invalid number of hotspots" << endl;
+ numhotspots = 0;
+ }
Hotspot::hotspots.resize(numhotspots);
for (int i = 0; i < Hotspot::hotspots.size(); i++) {
funpackf(tfile, "Bi Bf Bf Bf Bf", &Hotspot::hotspots[i].type, &Hotspot::hotspots[i].size, &Hotspot::hotspots[i].position.x, &Hotspot::hotspots[i].position.y, &Hotspot::hotspots[i].position.z);
LOGFUNC;
- try {
+ //~ try {
{
newGame();
CleanUp ();
return 0;
- } catch (const std::exception& error) {
- CleanUp();
+ //~ } catch (const std::exception& error) {
+ //~ CleanUp();
- std::string e = "Caught exception: ";
- e += error.what();
+ //~ std::string e = "Caught exception: ";
+ //~ e += error.what();
- LOG(e);
+ //~ LOG(e);
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
+ //~ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
- return -1;
- }
+ //~ return -1;
+ //~ }
}