Changeset 299 for trunk/UClientGUI.pas


Ignore:
Timestamp:
Jul 10, 2019, 5:48:18 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Error in case of missing building kind.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r294 r299  
    182182      Pen.Width := 1;
    183183    end else
    184     if Assigned(Cell.Building) and (Cell.Building.Kind.SpecialType = stCity) then begin
     184    if Assigned(Cell.Building) and Assigned(Cell.Building.Kind) and
     185    (Cell.Building.Kind.SpecialType = stCity) then begin
    185186      // Cannot set clear border as it will display shifted on gtk2
    186187      //Pen.Style := psClear;
     
    444445      for Cell in ControlPlayer.PlayerMap.Cells do begin
    445446        if (Cell.MapCell.Terrain <> ttVoid) and View.IsCellVisible(Cell.MapCell) then begin
    446           if Assigned(Cell.MapCell.Building) and (Cell.MapCell.Building.Kind.SpecialType = stCity) then begin
     447          if Assigned(Cell.MapCell.Building) and Assigned(Cell.MapCell.Building.Kind) and
     448          (Cell.MapCell.Building.Kind.SpecialType = stCity) then begin
    447449            // Cannot set clear border as it will display shifted on gtk2
    448450            //Pen.Style := psClear;
     
    464466        if (MapCell.Terrain <> ttVoid) and View.IsCellVisible(MapCell) then begin
    465467          if View.IsCellVisible(MapCell) and (MapCell.Terrain <> ttVoid) then begin
    466             if Assigned(MapCell.Building) and (MapCell.Building.Kind.SpecialType = stCity) then begin
     468            if Assigned(MapCell.Building) and Assigned(MapCell.Building.Kind) and
     469              (MapCell.Building.Kind.SpecialType = stCity) then begin
    467470              // Cannot set clear border as it will display shifted on gtk2
    468471              //Pen.Style := psClear;
Note: See TracChangeset for help on using the changeset viewer.