hedgewars/uDebug.pas
changeset 11537 bf86c6cb9341
parent 11512 bd9a2f1b0080
child 11549 b69f5f22a3ba
child 13083 dd904dd9c587
--- a/hedgewars/uDebug.pas	Sun Jan 24 00:02:57 2016 +0100
+++ b/hedgewars/uDebug.pas	Sun Jan 31 16:07:14 2016 +0300
@@ -23,7 +23,8 @@
 interface
 
 procedure OutError(Msg: shortstring; isFatalError: boolean);
-procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
+//procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
+function checkFails(Assert: boolean; Msg: shortstring; isFatal: boolean): boolean;
 function SDLCheck(Assert: boolean; Msg: shortstring; isFatal: boolean): boolean;
 
 var
@@ -50,6 +51,15 @@
     OutError(Msg, isFatal)
 end;
 
+function checkFails(Assert: boolean; Msg: shortstring; isFatal: boolean): boolean;
+begin
+    if not Assert then
+        OutError(Msg, false);
+
+    allOK:= allOK and (Assert or (not isFatal));
+    checkFails:= (not Assert) and isFatal
+end;
+
 function SDLCheck(Assert: boolean; Msg: shortstring; isFatal: boolean): boolean;
 var s: shortstring;
 begin