Changeset 129


Ignore:
Timestamp:
Jun 18, 2017, 11:13:05 AM (7 years ago)
Author:
chronos
Message:
  • Fixed: If only computer players are present in game then starts computer move immediatelly.
  • Fixed: Record players stats per entire turn and not per each player step.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r128 r129  
    5757    RegistryContext: TRegistryContext;
    5858    procedure LoadRecentExecute(Sender: TObject);
     59    procedure ProcessComputerTurns;
    5960    procedure StartNewGame;
    6061    procedure DoPlayerChange(Sender: TObject);
     
    274275end;
    275276
    276 procedure TCore.AGameEndTurnExecute(Sender: TObject);
     277procedure TCore.ProcessComputerTurns;
    277278var
    278279  Computer: TComputer;
    279280begin
    280   Game.NextTurn;
    281   FormMain.Redraw;
    282281  while Game.Running and (Game.CurrentPlayer.Mode <> pmHuman) do begin
    283282    if Game.CurrentPlayer.Mode = pmComputer then begin
     
    297296    Sleep(1);
    298297  end;
     298end;
     299
     300procedure TCore.AGameEndTurnExecute(Sender: TObject);
     301begin
     302  Game.NextTurn;
     303  FormMain.Redraw;
     304  ProcessComputerTurns;
    299305  UpdateActions;
    300306end;
     
    417423  FormMain.Redraw;
    418424  if FormCharts.Visible then FormCharts.Redraw;
     425  ProcessComputerTurns;
    419426  UpdateActions;
    420427end;
  • trunk/UGame.pas

    r128 r129  
    30373037  UpdateRepeatMoves(CurrentPlayer);
    30383038  ComputePlayerStats;
    3039   RecordTurnStats;
    30403039  PrevPlayer := CurrentPlayer;
    30413040  // Skip dead players
     
    30473046  if Players.IndexOf(CurrentPlayer) < Players.IndexOf(PrevPlayer) then begin
    30483047    Inc(TurnCounter);
     3048    RecordTurnStats;
    30493049    if Assigned(FOnNewTurn) then
    30503050      FOnNewTurn(Self);
Note: See TracChangeset for help on using the changeset viewer.