--- 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