Changeset 299


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

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormItem.lfm

    r296 r299  
    1212  OnDestroy = FormDestroy
    1313  OnShow = FormShow
    14   LCLVersion = '2.0.0.4'
     14  LCLVersion = '2.0.2.0'
    1515  object ButtonOk: TButton
    1616    Left = 74
     
    3030    Top = 260
    3131    Width = 94
    32     Anchors = [akLeft]
     32    Anchors = [akLeft, akBottom]
    3333    Caption = 'Cancel'
    3434    ModalResult = 2
  • trunk/UBuilding.pas

    r297 r299  
    4242  public
    4343    Kind: TBuildingKind;
     44    procedure Assign(Source: TItem); override;
    4445    property MapCell: TObject read FMapCell write SetMapCell; // TMapCell;
    4546  end;
     
    8889  FMapCell := AValue;
    8990  if Assigned(FMapCell) then TCell(FMapCell).Building := Self;
     91end;
     92
     93procedure TBuilding.Assign(Source: TItem);
     94begin
     95  inherited;
     96  Kind := TBuilding(Source).Kind;
    9097end;
    9198
  • 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;
  • trunk/UCore.pas

    r298 r299  
    483483  LocalClients := TClients.Create;
    484484  GameSettings := TGame.Create;
     485  GameSettings.FileName := 'Settings';
    485486  Game := TGame.Create;
    486487  Game.OnMoveUpdated := DoMoveUpdated;
  • trunk/UGame.pas

    r298 r299  
    6161    procedure WinObjectiveMapPrepare;
    6262  public
     63    FileName: string;
    6364    DevelMode: Boolean;
    6465    Players: TPlayers;
     
    8182    StayAliveForDefinedTurns: Integer;
    8283    MaxNeutralUnits: Integer;
    83     FileName: string;
    8484    FogOfWar: Boolean;
    8585    BridgeEnabled: Boolean;
  • trunk/UMap.pas

    r294 r299  
    622622      if Assigned(OneUnit) then
    623623        Inc(TotalUnits, OneUnit.Power);
    624       if Assigned(Building) and (Building.Kind.SpecialType = stCity) then
     624      if Assigned(Building) and Assigned(Building.Kind) and
     625      (Building.Kind.SpecialType = stCity) then
    625626        Inc(TotalCities);
    626627      if Extra = etObjectiveTarget then
Note: See TracChangeset for help on using the changeset viewer.