Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+// Enable full math definitions
+#define _USE_MATH_DEFINES
+
#if PLATFORM_UNIX
#include <sys/stat.h>
#include <sys/types.h>
#include <direct.h>
#endif
+
#include <limits>
#include <ctime>
+#include <cmath>
#include <dirent.h>
#include "Game.h"
#include "openal_wrapper.h"
is >> mapname;
is.ignore(256, ':');
is >> description;
- for (unsigned pos = description.find('_'); pos != string::npos; pos = description.find('_', pos)) {
+ for (size_t pos = description.find('_'); pos != string::npos; pos = description.find('_', pos)) {
description.replace(pos, 1, 1, ' ');
}
is.ignore(256, ':');
if (!accountactive)
return;
ifstream ipstream(ConvertFileName((":Data:Campaigns:" + accountactive->getCurrentCampaign() + ".txt").c_str()));
+ if (!ipstream.good()) {
+ if (accountactive->getCurrentCampaign() == "main") {
+ cerr << "Could not found main campaign!" << endl;
+ return;
+ }
+ cerr << "Could not found campaign \"" << accountactive->getCurrentCampaign() << "\", falling back to main." << endl;
+ accountactive->setCurrentCampaign("main");
+ return LoadCampaign();
+ }
ipstream.ignore(256, ':');
int numlevels;
ipstream >> numlevels;