From 2bd2bcbe8a077670806a4f97c0ad1213d12162ec Mon Sep 17 00:00:00 2001
From: DeaDDooMER <deaddoomer@deadsoftware.ru>
Date: Mon, 22 May 2023 20:48:31 +0300
Subject: [PATCH] test: fix error message on launch fail

---
 src/editor/f_main.pas | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 8d11a3b..be9dee3 100644
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
@@ -4311,6 +4311,8 @@ begin
   begin
     if MapTestProcess.Running = false then
     begin
+      if MapTestProcess.ExitCode <> 0 then
+        Application.MessageBox(PChar(_lc[I_MSG_EXEC_ERROR]), 'FIXME', MB_OK or MB_ICONERROR);
       SysUtils.DeleteFile(MapTestFile);
       MapTestFile := '';
       FreeAndNil(MapTestProcess);
@@ -6834,7 +6836,7 @@ begin
   end
   else
   begin
-    MessageBox(0, 'FIXME', PChar(_lc[I_MSG_EXEC_ERROR]), MB_OK or MB_ICONERROR);
+    Application.MessageBox(PChar(_lc[I_MSG_EXEC_ERROR]), 'FIXME', MB_OK or MB_ICONERROR);
     SysUtils.DeleteFile(newWAD);
     proc.Free();
   end;
-- 
2.29.2