]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Updating newdetail more often to avoid storing bad value, and added a newline at...
[lugaru.git] / Source / main.cpp
index 4ff4ebc29d788e0063ef18e70bbe2b0e1b44686b..10f2459eb4874ac1ff7c5b145bfa8ec999e2223e 100644 (file)
@@ -617,8 +617,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    debugmode = commandLineOptions[DEBUG];
-
     // !!! FIXME: we could use a Win32 API for this.  --ryan.
 #ifndef WIN32
     chdirToAppPath(argv[0]);
@@ -626,7 +624,9 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
+#ifdef NDEBUG
     try {
+#endif
         {
             newGame();
 
@@ -635,6 +635,10 @@ int main(int argc, char **argv)
                 return 42;
             }
 
+            if (commandLineOptions[DEBUG]) {
+                debugmode = true;
+            }
+
             bool gameDone = false;
             bool gameFocused = true;
 
@@ -677,6 +681,7 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
+#ifdef NDEBUG
     } catch (const std::exception& error) {
         CleanUp();
 
@@ -689,4 +694,5 @@ int main(int argc, char **argv)
 
         return -1;
     }
+#endif
 }