DEADSOFTWARE

gui: fix crash on language selection
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Tue, 23 May 2023 16:47:52 +0000 (19:47 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Tue, 23 May 2023 16:47:52 +0000 (19:47 +0300)
src/editor/f_main.pas

index 8fd661aa8cee44eea859fc0430053546421e87c1..21758243722bf2ee7f371fb9eb0750fad41f7afc 100644 (file)
@@ -6244,12 +6244,13 @@ begin
   MainForm.ActiveControl := RenderPanel;
 
 // Язык:
-  if gLanguage = '' then
+  if (gLanguage = '') and not (fsModal in SelectLanguageForm.FormState) then
   begin
     lang := SelectLanguageForm.ShowModal();
     case lang of
       1:   gLanguage := LANGUAGE_ENGLISH;
-      else gLanguage := LANGUAGE_RUSSIAN;
+      2:   gLanguage := LANGUAGE_RUSSIAN;
+      else gLanguage := LANGUAGE_ENGLISH;
     end;
 
     config := TConfig.CreateFile(CfgFileName);