DEADSOFTWARE

added "--gdb" cli arg to stop df from eating exceptions
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 16 Apr 2016 15:53:38 +0000 (18:53 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 16 Apr 2016 16:00:52 +0000 (19:00 +0300)
src/game/Doom2DF.dpr

index df5de459a118d12c5b4c42ec287d16b5ad0adb22..679615611ed466084ac3c576607f7c0ca86251c5 100644 (file)
@@ -95,14 +95,21 @@ uses
   {$R CustomRes.res}
 {$ENDIF}
 
+var
+  f: Integer;
+  noct: Boolean = false;
 begin
-  try
-    Main();
-    e_WriteLog('Shutdown with no errors.', MSG_NOTIFY);
-  except
-    on E: Exception do
-      e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
-    else
-      e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [LongWord(ExceptAddr())]), MSG_FATALERROR);
-  end;
+  for f := 1 to ParamCount do if ParamStr(f) = '--gdb' then noct := true;
+  if noct then
+    Main()
+  else
+    try
+      Main();
+      e_WriteLog('Shutdown with no errors.', MSG_NOTIFY);
+    except
+      on E: Exception do
+        e_WriteLog(Format(_lc[I_SYSTEM_ERROR_MSG], [E.Message]), MSG_FATALERROR);
+      else
+        e_WriteLog(Format(_lc[I_SYSTEM_ERROR_UNKNOWN], [LongWord(ExceptAddr())]), MSG_FATALERROR);
+    end;
 end.