Changeset 257 for trunk/UClientGUI.pas


Ignore:
Timestamp:
Sep 23, 2018, 12:29:16 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Selection of unit moves.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r248 r257  
    507507  end;
    508508  if Assigned(NewSelectedCell) then begin
    509     if (NewSelectedCell <> SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
    510       SelectedCell := NewSelectedCell
    511     end else
    512     if (NewSelectedCell = SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
    513       SelectedCell := nil;
    514     end else
    515     if Assigned(SelectedCell) and TGame(Game).Map.IsCellsNeighbor(NewSelectedCell.MapCell, SelectedCell.MapCell) then begin
     509    if Assigned(SelectedCell) and (NewSelectedCell <> SelectedCell) and
     510      TGame(Game).Map.IsCellsNeighbor(NewSelectedCell.MapCell, SelectedCell.MapCell) then begin
    516511      if ssShift in ShiftState then begin
    517512        // Make maximum unit move without confirmation dialog
     
    536531        SelectedCell := nil;
    537532      end;
     533    end else
     534    if (NewSelectedCell <> SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
     535      SelectedCell := NewSelectedCell
     536    end else
     537    if (NewSelectedCell = SelectedCell) and (NewSelectedCell.MapCell.Player = Player) then begin
     538      SelectedCell := nil;
    538539    end;
    539540  end;
Note: See TracChangeset for help on using the changeset viewer.