~chronoscz/xtactics/trunk

« back to all changes in this revision

Viewing changes to UClientGUI.pas

  • Committer: chronos
  • Date: 2019-07-10 15:48:18 UTC
  • Revision ID: svn-v4:473e92d2-f4b8-43ff-b2dd-7e42df4daf22:trunk:299
* Fixed: Error in case of missing building kind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
      Pen.Style := psSolid;
182
182
      Pen.Width := 1;
183
183
    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
185
186
      // Cannot set clear border as it will display shifted on gtk2
186
187
      //Pen.Style := psClear;
187
188
      Pen.Color := clBlack;
443
444
    if Assigned(ControlPlayer) then begin
444
445
      for Cell in ControlPlayer.PlayerMap.Cells do begin
445
446
        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
447
449
            // Cannot set clear border as it will display shifted on gtk2
448
450
            //Pen.Style := psClear;
449
451
            Pen.Color := clBlack;
463
465
      for MapCell in TGame(Game).Map.Cells do begin
464
466
        if (MapCell.Terrain <> ttVoid) and View.IsCellVisible(MapCell) then begin
465
467
          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
467
470
              // Cannot set clear border as it will display shifted on gtk2
468
471
              //Pen.Style := psClear;
469
472
              Pen.Color := clBlack;