Fix frontend error dialog always displaying "failed" as last engine message after engine crash
authorWuzzy <Wuzzy2@mail.ru>
Mon, 05 Mar 2018 16:16:32 +0100
changeset 13083 dd904dd9c587
parent 13082 c213645ff848
child 13084 81c154fd4380
Fix frontend error dialog always displaying "failed" as last engine message after engine crash
QTfrontend/game.cpp
hedgewars/uDebug.pas
--- a/QTfrontend/game.cpp	Sun Mar 04 00:13:38 2018 +0100
+++ b/QTfrontend/game.cpp	Mon Mar 05 16:16:32 2018 +0100
@@ -255,11 +255,10 @@
         {
             int size = msg.size();
             emit ErrorMessage(
-                tr("A Fatal ERROR occured! - The game engine had to stop.\n\n"
-                "We are very sorry for the inconvenience :(\n\n"
-                "If this keeps happening, please click the '%1' button in the main menu!\n\n"
-                "Last two engine messages:\n%2")
-                .arg("Feedback")
+                tr("A fatal ERROR occured! The game engine had to stop.\n\n"
+                "We are very sorry for the inconvenience. :-(\n\n"
+                "If this keeps happening, please click the 'Feedback' button in the main menu!\n\n"
+                "Last engine message:\n%1")
                 .arg(QString::fromUtf8(msg.mid(2).left(size - 4))));
             return;
         }
--- a/hedgewars/uDebug.pas	Sun Mar 04 00:13:38 2018 +0100
+++ b/hedgewars/uDebug.pas	Mon Mar 05 16:16:32 2018 +0100
@@ -54,7 +54,10 @@
 function checkFails(Assert: boolean; Msg: shortstring; isFatal: boolean): boolean;
 begin
     if not Assert then
+        begin
+        lastConsoleLine:= Msg;
         OutError(Msg, false);
+        end;
 
     allOK:= allOK and (Assert or (not isFatal));
     checkFails:= (not Assert) and isFatal