]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Reading debug mode from config again, but command line option overrides it
[lugaru.git] / Source / main.cpp
index 4ad68539203a1276274f91976449a7a26f7f8728..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,7 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
-#ifndef NDEBUG
+#ifdef NDEBUG
     try {
 #endif
         {
@@ -637,6 +635,10 @@ int main(int argc, char **argv)
                 return 42;
             }
 
+            if (commandLineOptions[DEBUG]) {
+                debugmode = true;
+            }
+
             bool gameDone = false;
             bool gameFocused = true;
 
@@ -679,7 +681,7 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
-#ifndef NDEBUG
+#ifdef NDEBUG
     } catch (const std::exception& error) {
         CleanUp();