Changeset 215


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.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.pas

    r213 r215  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, UCommPin,
     9  UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM,
    1010  UGeometry, UGameClient, UGameProtocol, UThreading;
    1111
  • trunk/Languages/xtactics.cs.po

    r213 r215  
    10261026msgid "64-bit UInt read overflow."
    10271027msgstr "Přetečení při čtení 64-bit UInt"
     1028
  • 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;
  • trunk/UGame.pas

    r213 r215  
    30463046  I: Integer;
    30473047begin
     3048  ReadXMLFile(Doc, FileName);
    30483049  Self.FileName := FileName;
    30493050  Clear;
    3050   ReadXMLFile(Doc, FileName);
    30513051  with Doc do try
    30523052    if Doc.DocumentElement.NodeName <> 'XtacticsGame' then
  • trunk/UGameProtocol.pas

    r213 r215  
    66
    77uses
    8   Classes, SysUtils, UGame, UVarBlockSerializer, UCommPin, SpecializedList,
    9   UCommFrame;
     8  Classes, SysUtils, UGame, UVarBlockSerializer, UCommPin, SpecializedList;
    109
    1110type
     
    5049    FOnSurrender: TNotifyEvent;
    5150    FOnTurnEnd: TNotifyEvent;
    52     CommFrame: TCommFrame;
    5351    procedure Receive(Sender: TCommPin; Stream: TListByte);
    5452    procedure SendCmd(Command: TCommand);
Note: See TracChangeset for help on using the changeset viewer.