Changeset 550 for trunk


Ignore:
Timestamp:
Apr 22, 2024, 10:17:01 PM (7 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/CityProcessing.pas

    r549 r550  
    14011401              and (TileInfo.Prod <= Hierarchy[iH, iT].Prod) and
    14021402              (TileInfo.Trade <= Hierarchy[iH, iT].Trade) and
    1403               not((TileInfo.Food = Hierarchy[iH, iT].Food) and
     1403              not ((TileInfo.Food = Hierarchy[iH, iT].Food) and
    14041404              (TileInfo.Prod = Hierarchy[iH, iT].Prod) and
    14051405              (TileInfo.Trade = Hierarchy[iH, iT].Trade) and
  • trunk/Database.pas

    r549 r550  
    18951895  if NewTile and fRR <> 0 then
    18961896    NewTile := NewTile and not fRoad;
    1897   if not((NewTile and fTerrain) in TerrType_Canalable) then
     1897  if not ((NewTile and fTerrain) in TerrType_Canalable) then
    18981898    NewTile := NewTile and not fCanal;
    18991899  if Terrain[NewTile and fTerrain].IrrEff = 0 then
     
    19611961    begin // search exploiting player and city
    19621962      SearchCity(UsedByCity[Loc], P, cix);
    1963       if not((P = p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and
     1963      if not ((P = p0) or (ObserveLevel[UsedByCity[Loc]] shr (2 * p0) and
    19641964        3 = lObserveSuper)) then
    19651965        cix := -1
     
    27672767  Dec(TerritoryCount[RealMap[Loc] shr 27]);
    27682768  Inc(TerritoryCount[P]);
    2769   RealMap[Loc] := RealMap[Loc] and not($F shl 27) or Cardinal(P) shl 27;
     2769  RealMap[Loc] := RealMap[Loc] and not ($F shl 27) or Cardinal(P) shl 27;
    27702770  if P = $F then
    27712771    P := -1;
     
    29212921            if NewOwner <> OldOwner then
    29222922              if AtPeace[NewOwner, OldOwner] and
    2923                 not((OldOwner = PlayerLosingCity) and
     2923                not ((OldOwner = PlayerLosingCity) and
    29242924                (StolenDist[Loc] > CountryRadius)) then
    29252925                NewOwner := OldOwner // peace fixes borders
  • trunk/GameServer.pas

    r549 r550  
    27382738
    27392739  if (1 shl Player and (GAlive or GWatching) = 0) and
    2740     not((Command = sTurn) or (Command = sBreak) or (Command = sResign) or
     2740    not ((Command = sTurn) or (Command = sBreak) or (Command = sResign) or
    27412741    (Command = sGetAIInfo) or (Command = sGetAICredits) or
    27422742    (Command = sGetVersion) or (Command and $FF0F = sGetChart)) then
     
    27502750
    27512751  // check if command allowed now
    2752   if (Mode = moPlaying) and not((Command >= cClientEx) or (Command = sMessage)
     2752  if (Mode = moPlaying) and not ((Command >= cClientEx) or (Command = sMessage)
    27532753    or (Command = sSetDebugMap) or (Command = sGetDebugMap) or
    27542754    (Command = sGetAIInfo) or (Command = sGetAICredits) or
     
    27602760    (Command and $FF0F = sGetChart) or (Command and $FF0F = sSetAttitude))
    27612761  // commands always allowed
    2762     and not((Player = pTurn) and (Command < $1000))
     2762    and not ((Player = pTurn) and (Command < $1000))
    27632763  // info request always allowed for pTurn
    27642764    and ((pDipActive < 0) and (Player <> pTurn) // not his turn
     
    38703870            if 1 shl Domain and Feature[Subject].Domains = 0 then
    38713871              Result := eDomainMismatch
    3872             else if not((Feature[Subject].Preq = preNone) or
     3872            else if not ((Feature[Subject].Preq = preNone) or
    38733873              (Feature[Subject].Preq = preSun) and
    38743874              (GWonder[woSun].EffectiveOwner = Player) or
     
    42004200                  Result := eInvalid
    42014201                else if (NewProject and cpConscripts <> 0) and
    4202                   not((RW[Player].Tech[adConscription] >= tsApplicable) and
     4202                  not ((RW[Player].Tech[adConscription] >= tsApplicable) and
    42034203                  (RW[Player].Model[NewProject and cpIndex].Domain = dGround)
    42044204                  and (RW[Player].Model[NewProject and cpIndex].Kind < mkScout))
  • trunk/LocalPlayer/CityScreen.pas

    r549 r550  
    11881188    begin
    11891189      I := 5;
    1190       while (I >= 0) and not((X >= xZoomMap + 14 + 72 * (I mod 3)) and
     1190      while (I >= 0) and not ((X >= xZoomMap + 14 + 72 * (I mod 3)) and
    11911191        (X < xZoomMap + 14 + 56 + 72 * (I mod 3)) and
    11921192        (Y >= yZoomMap + 14 + 56 * (I div 3)) and
     
    12991299    begin
    13001300      I := 5;
    1301       while (I >= 0) and not((X >= xZoomMap + 64 * (I mod 3)) and
     1301      while (I >= 0) and not ((X >= xZoomMap + 64 * (I mod 3)) and
    13021302        (X < xZoomMap + 64 + 64 * (I mod 3)) and
    13031303        (Y >= yZoomMap + 20 + 48 * (I div 3)) and
  • trunk/LocalPlayer/Diagram.pas

    r536 r550  
    111111      Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[3] + 32,
    112112        Top + 100 + 46 + yComp[3], 16, 27, 18, 82);
    113     if (nComp <> 6) and (nComp <> 2) and not((nComp = 0) and (nPow < 1)) then
     113    if (nComp <> 6) and (nComp <> 2) and not ((nComp = 0) and (nPow < 1)) then
    114114      Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[nComp],
    115115        Top + 100 + 7 + yComp[nComp], 16, 27, 18, 82);
    116     if (nComp <> 6) and (nComp <> 3) and not((nComp = 0) and (nPow < 2)) then
     116    if (nComp <> 6) and (nComp <> 3) and not ((nComp = 0) and (nPow < 2)) then
    117117      Sprite(Canvas, HGrSystem2, Left + Width div 2 + xComp[nComp],
    118118        Top + 100 + 46 + yComp[nComp], 16, 27, 18, 82);
  • trunk/LocalPlayer/Draft.pas

    r549 r550  
    379379      ((Feature[I].Preq = preSun) and (MyRO.Wonder[woSun].EffectiveOwner = Me)
    380380      or (Feature[I].Preq >= 0) and (MyRO.Tech[Feature[I].Preq] >= tsApplicable)
    381       ) and not((Feature[I].Preq = adSteamEngine) and
     381      ) and not ((Feature[I].Preq = adSteamEngine) and
    382382      (MyRO.Tech[adNuclearPower] >= tsApplicable)) then
    383383    begin
  • trunk/LocalPlayer/Help.pas

    r549 r550  
    567567          else if HelpLineInfo.CrossLink then
    568568            Sprite(OffScreen, HGrSystem, 12, I * 24 + 5, 14, 14, 80, 1)
    569           else if not((Kind = hkMisc) and (No = Integer(miscMain))) then
     569          else if not ((Kind = hkMisc) and (No = Integer(miscMain))) then
    570570            Sprite(OffScreen, HGrSystem, 10, I * 24 + 6, 14, 14, 65, 1);
    571571          x0[I] := 24;
  • trunk/LocalPlayer/IsoEngine.pas

    r549 r550  
    988988  begin
    989989    Conn := Connection4(Loc, fRiver, fRiver) or
    990       Connection4(Loc, fTerrain, fShore) or Connection4(Loc, fTerrain,
    991       fUNKNOWN);
     990      Connection4(Loc, fTerrain, fShore) or Connection4(Loc, fTerrain, fUNKNOWN);
    992991    TerrainSprite(X, Y, spRiver + Conn mod 8 + (Conn div 8) * TerrainIconCols);
    993992  end;
     
    12601259        UnitInfo.Health := DefHealth;
    12611260      if (UnitInfo.Owner <> CityOwner) and
    1262         not((CityOwner = Me) and (MyRO.Treaty[UnitInfo.Owner] = trAlliance))
     1261        not ((CityOwner = Me) and (MyRO.Treaty[UnitInfo.Owner] = trAlliance))
    12631262      then
    12641263{$IFNDEF SCR} if (UnFocus >= 0) and (Loc = MyUn[UnFocus].Loc) then { active unit }
  • trunk/LocalPlayer/Select.pas

    r549 r550  
    181181    LoweredTextOut(Canvas, -1, MainTexture,
    182182      (Width - BiColorTextWidth(Canvas, S)) div 2, 31, S);
    183   if not MultiPage and (Kind in [kProject, kAdvance, kFarAdvance]) and not Phrases2FallenBackToEnglish
    184   then
    185   begin
     183  if not MultiPage and (Kind in [kProject, kAdvance, kFarAdvance]) and
     184    not Phrases2FallenBackToEnglish then begin
    186185    S := Phrases2.Lookup('SHIFTCLICK');
    187186    LoweredTextOut(Canvas, -2, MainTexture,
     
    13961395          Code[1, Lines[0]] := MyRO.nEnemyModel - 1;
    13971396          while (Code[1, Lines[0]] >= 0) and
    1398             not((MyRO.EnemyModel[Code[1, Lines[0]]].Owner = pView) and
     1397            not ((MyRO.EnemyModel[Code[1, Lines[0]]].Owner = pView) and
    13991398            (MyRO.EnemyModel[Code[1, Lines[0]]].mix = I)) do
    14001399            Dec(Code[1, Lines[0]]);
     
    16781677begin
    16791678  ForceClose := (ListKind <> Kind) and
    1680     not((Kind = kCities) and (ListKind = kCityEvents)) and
    1681     not((Kind = kCityEvents) and (ListKind = kCities)) and
    1682     not((Kind = kModels) and (ListKind = kEModels)) and
    1683     not((Kind = kEModels) and (ListKind = kModels));
     1679    not ((Kind = kCities) and (ListKind = kCityEvents)) and
     1680    not ((Kind = kCityEvents) and (ListKind = kCities)) and
     1681    not ((Kind = kModels) and (ListKind = kEModels)) and
     1682    not ((Kind = kEModels) and (ListKind = kModels));
    16841683
    16851684  Kind := ListKind;
  • trunk/LocalPlayer/Term.pas

    r549 r550  
    12791279  Loc0: Integer;
    12801280begin
    1281   Assert(not((uix >= 0) and Supervising));
     1281  Assert(not ((uix >= 0) and Supervising));
    12821282  if uix <> UnFocus then
    12831283  begin
     
    30823082    cShowUnitChanged, cShowCityChanged, cShowAfterMove, cShowAfterAttack:
    30833083      if (Idle and (NewPlayer = Me) or not Idle and not skipped) and
    3084         not((GameMode = cMovie) and (MovieSpeed = 4)) then
     3084        not ((GameMode = cMovie) and (MovieSpeed = 4)) then
    30853085      begin
    30863086        Assert(NewPlayer = Me);
     
    31463146      if (Idle and (NewPlayer = Me) or not Idle and not skipped and
    31473147        (TShowMove(Data).emix <> $FFFF)) and
    3148         not((GameMode = cMovie) and (MovieSpeed = 4)) then
     3148        not ((GameMode = cMovie) and (MovieSpeed = 4)) then
    31493149      begin
    31503150        Assert(NewPlayer = Me);
     
    33273327      if (Idle and (NewPlayer = Me) or not Idle and not skipped and
    33283328        (TShowMove(Data).emix <> $FFFF)) and
    3329         not((GameMode = cMovie) and (MovieSpeed = 4)) then
     3329        not ((GameMode = cMovie) and (MovieSpeed = 4)) then
    33303330      begin
    33313331        Assert(NewPlayer = Me);
     
    60236023  begin // attack -- search enemy unit
    60246024    if (MyModel[MyUn[UnFocus].mix].Attack = 0) and
    6025       not((MyModel[MyUn[UnFocus].mix].Cap[mcBombs] > 0) and
     6025      not ((MyModel[MyUn[UnFocus].mix].Cap[mcBombs] > 0) and
    60266026      (MyUn[UnFocus].Flags and unBombsLoaded <> 0)) then
    60276027    begin
     
    76197619      ((MyRO.Wonder[woGardens].EffectiveOwner = Me) or
    76207620      (Tile and fTerrain <> fArctic) and (Tile and fTerrain <> fDesert)) and
    7621       not((mox.Domain = dAir) and (Tile and fCity = 0) and
     7621      not ((mox.Domain = dAir) and (Tile and fCity = 0) and
    76227622      (Tile and fTerImp <> tiBase));
    7623     mStay.Visible := not((mox.Domain = dAir) and (Tile and fCity = 0) and
     7623    mStay.Visible := not ((mox.Domain = dAir) and (Tile and fCity = 0) and
    76247624      (Tile and fTerImp <> tiBase));
    76257625    mCity.Visible := Extended and (mox.Kind = mkSettler) or
  • trunk/UnitProcessing.pas

    r447 r550  
    293293          end
    294294          else if (PModel.Attack = 0) and
    295             not((PModel.Cap[mcBombs] > 0) and (Flags and unBombsLoaded <> 0))
     295            not ((PModel.Cap[mcBombs] > 0) and (Flags and unBombsLoaded <> 0))
    296296          then
    297297          begin
     
    495495      Exit;
    496496    end;
    497     if (PModel.Attack = 0) and not((PModel.Cap[mcBombs] > 0) and
     497    if (PModel.Attack = 0) and not ((PModel.Cap[mcBombs] > 0) and
    498498      (FlagsAtt and unBombsLoaded <> 0) and (DModel.Domain < dAir)) then
    499499    begin
     
    890890        ToTile := Map[Loc1];
    891891        if (Loc1 = A.ToLoc) and (ToTile and (fUnit or fOwned) = fUnit) and
    892           not((MoveInfo and 3 = gmaSea) and (FromTile and fTerrain >= fGrass))
    893           and not((MoveInfo and 3 = gmaAir) and ((FromTile and fCity <> 0) or
     892          not ((MoveInfo and 3 = gmaSea) and (FromTile and fTerrain >= fGrass))
     893          and not ((MoveInfo and 3 = gmaAir) and ((FromTile and fCity <> 0) or
    894894          (FromTile and fTerImp = tiBase))) then
    895895        begin // attack position found
     
    13091309    TerrType := RealMap[Loc0] and fTerrain;
    13101310    if (RealMap[Loc0] and fCity <> 0) or (TerrType < fGrass) or (Master >= 0) or
    1311       not((NewJob = jPillage) and (RW[P].Model[mix].Domain = dGround) or
     1311      not ((NewJob = jPillage) and (RW[P].Model[mix].Domain = dGround) or
    13121312      (RW[P].Model[mix].Kind = mkSettler) or (NewJob <> jCity) and
    13131313      (RW[P].Model[mix].Kind = mkSlaves) and (GWonder[woPyramids].EffectiveOwner
  • trunk/readme.txt

    r422 r550  
    22===================
    33
    4 * Developed with: Lazarus 2.2.0 (https://www.lazarus-ide.org/)
    54* Supported platforms: Windows and Linux
    65* Supported architectures: 32-bit and 64-bit x86
     
    1918* Design time components converted to Lazarus package (cevocomponenets.lpk)
    2019* User configurable key bindings
     20* High DPI screens support
    2121
    2222= Development =
     
    2424* Home page: https://app.zdechov.net/c-evo/
    2525* Source code: https://svn.zdechov.net/c-evo/
    26 * Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 2.2.0
     26* Developed in [http://www.lazarus-ide.org/ Lazarus/FPC] 3.2.0
    2727* To build new Windows installer run Install/build.bat. InnoSetup (http://www.jrsoftware.org/isdl.php) needs to be installed).
    2828
     
    3939The C-evo sources
    4040
    41 - Please read the "Module Concept" section of the document 
     41- Please read the "Module Concept" section of the document
    4242  http://c-evo.org/aidev.html
    43   to understand the client/server architecture of the game before you 
     43  to understand the client/server architecture of the game before you
    4444  try to understand the rest.
    4545
    4646- The package includes components named TButtonA, TButtonB, TButtonC,
    47   TButtonN and TEOTButton. You must install these before you open the 
     47  TButtonN and TEOTButton. You must install these before you open the
    4848  cevo project.
    4949
Note: See TracChangeset for help on using the changeset viewer.