Changeset 274 for trunk/UClientGUI.pas


Ignore:
Timestamp:
Feb 3, 2019, 8:32:20 PM (6 years ago)
Author:
chronos
Message:
  • Added: Keep information about available unit moves during turn.
  • Added: Allow to move units instantly during turn.
  • Added: Game system parameter to play without possibility to merge/split units.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r273 r274  
    352352          if Assigned(SelectedCell) and (SelectedCell = Cell) then
    353353              Brush.Color := clGreen
    354             else if Assigned(SelectedCell) and TGame(Game).Map.IsCellsNeighbor(SelectedCell.MapCell, Cell.MapCell) then
     354            else if Assigned(SelectedCell) and ControlPlayer.IsAllowedMoveTarget(SelectedCell, Cell) then
    355355              Brush.Color := clPurple
    356356            else if TGame(Game).FogOfWar then begin
     
    616616  if Assigned(NewSelectedCell) then begin
    617617    if Assigned(SelectedCell) and (NewSelectedCell <> SelectedCell) and
    618       TGame(Game).Map.IsCellsNeighbor(NewSelectedCell.MapCell, SelectedCell.MapCell) then begin
     618    TGame(Game).CurrentPlayer.IsAllowedMoveTarget(SelectedCell, NewSelectedCell) then begin
    619619      if ssShift in ShiftState then begin
    620620        // Make maximum unit move without confirmation dialog
     
    640640      end;
    641641    end else
    642     if (NewSelectedCell <> SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
     642    if not Assigned(SelectedCell) and (NewSelectedCell <> SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
    643643      SelectedCell := NewSelectedCell
    644644    end else
Note: See TracChangeset for help on using the changeset viewer.