Changeset 287 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 24, 2019, 2:26:29 PM (6 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r284 r287  
    353353
    354354procedure TCore.AGameNewExecute(Sender: TObject);
     355var
     356  NewServer: TServer;
    355357begin
    356358  FormNew := TFormNew.Create(nil);
    357359  try
    358     FormNew.Load(Server);
     360    NewServer := TServer.Create;
     361    NewServer.Assign(Server);
     362    NewServer.Game := TGame.Create;
     363    NewServer.Game.Assign(GameSettings);
     364    FormNew.Server := NewServer;
    359365    FormNew.PageControl1.TabIndex := FormNewTabIndex;
    360366    if FormNew.ShowModal = mrOk then begin
     367      Server.Assign(NewServer);
     368      Server.Game := Game;
    361369      Game.Running := False;
    362       FormNew.Save(Server);
    363       GameSettings.PostConfig;
    364       Game.Assign(GameSettings);
     370      Game.PostConfig;
     371      Game.Assign(NewServer.Game);
     372      GameSettings.Assign(NewServer.Game);
    365373      SaveConfigAll;
    366374      StartNewGame;
     
    368376    end;
    369377    FormNewTabIndex := FormNew.PageControl1.TabIndex;
     378    NewServer.Game.Free;
     379    NewServer.Game := nil;
     380    NewServer.Free;
    370381  finally
    371382    FormNew.Free;
Note: See TracChangeset for help on using the changeset viewer.