Changeset 558 for trunk/Database.pas


Ignore:
Timestamp:
Apr 25, 2024, 6:31:34 PM (7 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r550 r558  
    889889  for I := 0 to 11 do
    890890  begin
    891     RealMap[RareLoc[I]] := RealMap[RareLoc[I]] and not(fTerrain or fSpecial) or
     891    RealMap[RareLoc[I]] := RealMap[RareLoc[I]] and not (fTerrain or fSpecial) or
    892892      (fDesert or fDeadLands);
    893893    for dy := -1 to 1 do
     
    14891489  begin
    14901490    RealMap[StartLoc0[p1]] := RealMap[StartLoc0[p1]] and
    1491       not(fTerrain or fSpecial) or fGrass or fSpecial1;
     1491      not (fTerrain or fSpecial) or fGrass or fSpecial1;
    14921492    CntGood := 1;
    14931493    CntGoodGrass := 1;
     
    15121512          then
    15131513          begin
    1514             RealMap[Loc1] := RealMap[Loc1] and not(fTerrain or fSpecial)
     1514            RealMap[Loc1] := RealMap[Loc1] and not (fTerrain or fSpecial)
    15151515              or fGrass;
    15161516            RealMap[Loc1] := RealMap[Loc1] or ActualSpecialTile(Loc1) shl 5;
     
    16981698          ResourceMask[P] := $FFFFFFFF
    16991699        else
    1700           ResourceMask[P] := $FFFFFFFF and not(fSpecial2 or fModern);
     1700          ResourceMask[P] := $FFFFFFFF and not (fSpecial2 or fModern);
    17011701        GrWallContinent[P] := -1;
    17021702
     
    18991899  if Terrain[NewTile and fTerrain].IrrEff = 0 then
    19001900  begin
    1901     NewTile := NewTile and not(fPrefStartPos or fStartPos);
     1901    NewTile := NewTile and not (fPrefStartPos or fStartPos);
    19021902    if (NewTile and fTerImp = tiIrrigation) or (NewTile and fTerImp = tiFarm)
    19031903    then
     
    21102110          Inc(TestDet, 1 shl 28)
    21112111        else if (Domain = dGround) and (PModel.Cap[mcFanatic] > 0) and
    2112           not(RW[Defender].Government in [gRepublic, gDemocracy, gFuture]) then
     2112          not (RW[Defender].Government in [gRepublic, gDemocracy, gFuture]) then
    21132113          Inc(TestDet, 4 shl 28) // fanatic ground units always defend
    21142114        else if PModel.Flags and mdZOC <> 0 then
     
    24272427      Inc(Discovered[pTell]);
    24282428    if euix >= -1 then
    2429       Map[Loc] := Map[Loc] and not(fUnit or fCity or fOwned or fOwnZoCUnit) or
     2429      Map[Loc] := Map[Loc] and not (fUnit or fCity or fOwned or fOwnZoCUnit) or
    24302430        (Tile and $07FFFFFF or AddFlags) and
    24312431        (fUnit or fCity or fOwned or fOwnZoCUnit)
     
    24392439      MapObservedLast[Loc] := GTurn
    24402440    end;
    2441     ObserveLevel[Loc] := ObserveLevel[Loc] and not(3 shl (2 * pTell)) or
     2441    ObserveLevel[Loc] := ObserveLevel[Loc] and not (3 shl (2 * pTell)) or
    24422442      Cardinal(Level) shl (2 * pTell);
    24432443  end;
     
    26532653        else if (Occupant[Loc] <> P) or CityChange then
    26542654        begin // city or enemy unit update necessary, call DiscoverTile
    2655           ObserveLevel[Loc] := ObserveLevel[Loc] and not(3 shl (2 * P));
     2655          ObserveLevel[Loc] := ObserveLevel[Loc] and not (3 shl (2 * P));
    26562656          DiscoverTile(Loc, P, P, OldLevel, False, euix);
    26572657        end
     
    30033003  begin
    30043004    Job := jNone;
    3005     Flags := Flags and not(unFortified or unMountainDelay);
     3005    Flags := Flags and not (unFortified or unMountainDelay);
    30063006    Loc0 := Loc;
    30073007  end;
     
    31393139      dxdy(UsedByCity[FoundLoc], FoundLoc, dx, dy);
    31403140      V21 := (dy + 3) shl 2 + (dx + 3) shr 1;
    3141       RW[p1].City[cix1].Tiles := RW[p1].City[cix1].Tiles and not(1 shl V21);
     3141      RW[p1].City[cix1].Tiles := RW[p1].City[cix1].Tiles and not (1 shl V21);
    31423142    end;
    31433143    Tiles := 1 shl 13; { exploit central tile }
     
    32323232    V21_to_Loc(Loc, Radius);
    32333233    for V21 := 1 to 26 do
    3234       if Tiles and (1 shl V21) and not(1 shl CityOwnTile) <> 0 then
     3234      if Tiles and (1 shl V21) and not (1 shl CityOwnTile) <> 0 then
    32353235      begin
    32363236        Loc1 := Radius[V21];
     
    32393239          (RW[pNew].Treaty[Occupant[Loc1]] < trAlliance) then
    32403240        begin // tile can't remain exploited
    3241           Tiles := Tiles and not(1 shl V21);
     3241          Tiles := Tiles and not (1 shl V21);
    32423242          UsedByCity[Loc1] := -1;
    32433243        end;
     
    33023302        RealMap[Loc] := RealMap[Loc] and not fTerrain or
    33033303          Cardinal(ChangedTerrain);
    3304         RealMap[Loc] := RealMap[Loc] and not(3 shl 5) or
     3304        RealMap[Loc] := RealMap[Loc] and not (3 shl 5) or
    33053305          ActualSpecialTile(Loc) shl 5;
    33063306      end;
     
    33143314        RealMap[Loc] := RealMap[Loc] and not fTerrain or
    33153315          Cardinal(ChangedTerrain);
    3316         RealMap[Loc] := RealMap[Loc] and not(3 shl 5) or
     3316        RealMap[Loc] := RealMap[Loc] and not (3 shl 5) or
    33173317          ActualSpecialTile(Loc) shl 5;
    33183318      end;
     
    33283328        RealMap[Loc] := RealMap[Loc] and not fTerrain or
    33293329          Cardinal(ChangedTerrain);
    3330         RealMap[Loc] := RealMap[Loc] and not(3 shl 5) or
     3330        RealMap[Loc] := RealMap[Loc] and not (3 shl 5) or
    33313331          ActualSpecialTile(Loc) shl 5;
    3332         if not(RealMap[Loc] and fTerrain in TerrType_Canalable) then
     3332        if not (RealMap[Loc] and fTerrain in TerrType_Canalable) then
    33333333        begin
    33343334          RemoveDomainUnits(dSea, P, Loc);
     
    33763376        (ObserveLevel[Loc] shr (2 * p1) and 3 > lNoObserve) then
    33773377        RW[p1].Map[Loc] := RW[p1].Map[Loc] and
    3378           not(fTerrain or fSpecial or fTerImp or fRoad or fRR or fCanal or
     3378          not (fTerrain or fSpecial or fTerImp or fRoad or fRR or fCanal or
    33793379          fPoll) or RealMap[Loc] and (fTerrain or fSpecial or fTerImp or
    33803380          fRoad or fRR or fCanal or fPoll);
     
    35643564            RW[pTarget].EnemyCity[cix].Loc := -1;
    35653565
    3566       Tile := Tile and (not(fSpecial or fModern) or ResourceMask[pTarget]);
     3566      Tile := Tile and (not (fSpecial or fModern) or ResourceMask[pTarget]);
    35673567      Tile := Tile or (RW[pTarget].Map[Loc] and fModern);
    35683568      if (Tile and fTerrain = RW[pTarget].Map[Loc] and fTerrain) then
     
    35733573      RW[pTarget].Map[Loc] := RW[pTarget].Map[Loc] and fInEnemyZoC
    35743574      // always preserve this flag!
    3575         or Tile and not(fUnit or fHiddenUnit or fStealthUnit or fObserved or
     3575        or Tile and not (fUnit or fHiddenUnit or fStealthUnit or fObserved or
    35763576        fSpiedOut or fOwned or fInEnemyZoC or fOwnZoCUnit or fPeace or fGrWall);
    35773577      if RW[pSender].Territory[Loc] <> RW[pTarget].Territory[Loc] then
     
    36643664              RecalcMapZoC(pTarget);
    36653665            end;
    3666             if not(NewTreaty in [trPeace, TrFriendlyContact]) then
     3666            if not (NewTreaty in [trPeace, TrFriendlyContact]) then
    36673667            begin
    36683668              RW[pSender].EvaStart[pTarget] := -PeaceEvaTurns - 1;
     
    39103910      begin
    39113911        for I := 0 to nAdv - 1 do // give all techs to player p1
    3912           if not(I in FutureTech) and (RW[p1].Tech[I] < tsApplicable) then
     3912          if not (I in FutureTech) and (RW[p1].Tech[I] < tsApplicable) then
    39133913          begin
    39143914            RW[p1].Tech[I] := tsCheat;
Note: See TracChangeset for help on using the changeset viewer.