Changeset 215 for trunk/UCore.pas


Ignore:
Timestamp:
May 25, 2018, 8:30:06 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Exceptions if game should be loaded from the file which doesn't exist.
  • Fixed: New game creation after application start if it isn't loaded from file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r213 r215  
    88  Classes, SysUtils, XMLConf, FileUtil, ActnList, Controls, Dialogs, Forms,
    99  UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator,
    10   URegistry, ULastOpenedList, Registry, Menus, UGeometry, UFormClient,
    11   UGameServer, UGameClient, fgl, UServerList, UGameProtocol;
     10  URegistry, ULastOpenedList, Registry, Menus, UFormClient,
     11  UGameServer, UGameClient, fgl, UServerList;
    1212
    1313type
     
    615615
    616616    CommandLineParams;
    617     if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) then
     617    if not GameLoaded and ReopenLastFile and (LastOpenedList1.Items.Count > 0) and
     618      FileExists(LastOpenedList1.Items[0]) then
    618619      LoadGame(LastOpenedList1.Items[0]);
    619620    FormClientActions;
    620621
    621     if Game.FileName = '' then StartNewGame;
     622    if Game.FileName = '' then begin
     623      Game.Assign(GameSettings);
     624      StartNewGame;
     625    end;
    622626  end;
    623627end;
Note: See TracChangeset for help on using the changeset viewer.