Changeset 330 for trunk/Map.pas


Ignore:
Timestamp:
Jul 19, 2024, 9:46:33 PM (4 months ago)
Author:
chronos
Message:
  • Fixed: New game symetric map units calcualtion.
  • Fixed: Map preview with cell and unit borders.
  • Fixed: Allow to set preferred game system grid type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Map.pas

    r322 r330  
    663663  for C := 0 to (Cells.Count div 2) - 1 do begin
    664664    Cells[C].Terrain := Cells[Cells.Count - 1 - C].Terrain;
    665     Cells[C].OneUnit.Power := Cells[Cells.Count - 1 - C].OneUnit.Power;
     665
     666    // Sync units
     667    if not Assigned(Cells[C].OneUnit) and Assigned(Cells[Cells.Count - 1 - C].OneUnit) then begin
     668      Cells[C].OneUnit := TGame(Game).Units.AddNew(Cells[Cells.Count - 1 - C].OneUnit.Kind,
     669        Cells[Cells.Count - 1 - C].OneUnit.Power);
     670    end;
     671    if Assigned(Cells[C].OneUnit) and Assigned(Cells[Cells.Count - 1 - C].OneUnit) then
     672      Cells[C].OneUnit.Power := Cells[Cells.Count - 1 - C].OneUnit.Power;
     673
     674    if Assigned(Cells[C].OneUnit) and not Assigned(Cells[Cells.Count - 1 - C].OneUnit) then begin
     675      TGame(Game).Units.Remove(Cells[C].OneUnit);
     676    end;
    666677
    667678    for I := Cells[C].Links.Count - 1 downto 0 do begin
Note: See TracChangeset for help on using the changeset viewer.