Changeset 328


Ignore:
Timestamp:
Mar 25, 2021, 3:02:29 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Use nWonder constant as number of wonders instead of numeric value.
  • Modified: Code cleanup.
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/AI/StdAI/AI.pas

    r319 r328  
    11221122            begin // settlers could be added to this city
    11231123              Happy := BasicHappy;
    1124               for i := 0 to 27 do
     1124              for i := 0 to nWonder - 1 do
    11251125                if Built[i] > 0 then
    11261126                  Inc(Happy);
  • trunk/AI/StdAI/Barbarina.pas

    r319 r328  
    12421242      WonderAvailable := WonderAvailable and PrimeWonder; // alway prefer prime wonders
    12431243    Count := 0;
    1244     for iix := 0 to 27 do
     1244    for iix := 0 to nWonder - 1 do
    12451245    begin
    12461246      if (1 shl iix) and WonderAvailable <> 0 then
     
    12541254    end;
    12551255    Count := Random(Count);
    1256     for iix := 0 to 27 do
     1256    for iix := 0 to nWonder - 1 do
    12571257    begin
    12581258      if (1 shl iix) and WonderAvailable <> 0 then
     
    13261326  WonderAvailable := 0;
    13271327  WonderInWork := 0;
    1328   for iix := 0 to 27 do
     1328  for iix := 0 to nWonder - 1 do
    13291329    if (Imp[iix].Preq <> preNA) and ((Imp[iix].Preq = preNone) or
    13301330      IsResearched(Imp[iix].Preq)) and (RO.Wonder[iix].CityID = WonderNotBuiltYet) then
     
    13341334    begin
    13351335      iix := City_CurrentImprovementProject(cix);
    1336       if (iix >= 0) and (iix < 28) then
     1336      if (iix >= 0) and (iix < nWonder) then
    13371337        Inc(WonderInWork, 1 shl iix)
    13381338      else if iix = imPalace then
     
    14281428
    14291429          iix := City_CurrentImprovementProject(cix);
    1430           if (iix >= 0) and (iix < 28) or (iix = imPalace) or
     1430          if (iix >= 0) and (iix < nWonder) or (iix = imPalace) or
    14311431            (iix = imShipComp) or (iix = imShipPow) or (iix = imShipHab) then
    14321432            City_OptimizeTiles(cix, rwMaxProd)
     
    14471447          if cix = cixNewCapital then
    14481448            City_StartImprovement(cix, imPalace)
    1449           else if (iix >= 0) and (iix < 28) and ((1 shl iix) and
     1449          else if (iix >= 0) and (iix < nWonder) and ((1 shl iix) and
    14501450            WonderAvailable <> 0) then
    14511451          // complete wonder production first
     
    15031503                City_StartImprovement(cix, woZeus)
    15041504              else if (City_CurrentImprovementProject(cix) >= 0) and
    1505                 (City_CurrentImprovementProject(cix) < 28) then
     1505                (City_CurrentImprovementProject(cix) < nWonder) then
    15061506              begin// wonder already built, try to switch to different one
    15071507                if (WonderAvailable and not WonderInWork > 0) and
     
    15531553              begin // low prio projects
    15541554                ImportantCity := WillProduceColonyShip or (Built[imPalace] > 0);
    1555                 for iix := 0 to 27 do
     1555                for iix := 0 to nWonder - 1 do
    15561556                  if Built[iix] > 0 then
    15571557                    ImportantCity := True;
     
    16051605            City_RebuildImprovement(cix, imTownHall)
    16061606          else if (RO.Government = gFundamentalism) and not WillProduceColonyShip then
    1607             for iix := 28 to nImp - 1 do
     1607            for iix := nWonder to nImp - 1 do
    16081608              if (Built[iix] > 0) and
    16091609                ((iix in [imTemple, imTheater, imCathedral, imColosseum,
  • trunk/AI/StdAI/Protocol.pas

    r319 r328  
    1111  nImp = 70; { number of improvements }
    1212  nPl = 15; { max number of players, don't change! }
     13  nWonder = 28; { max number of wonders }
    1314  nUmax = 4096; { max units/player, don't set above 4096 }
    1415  nCmax = 1024; { max cities/player, don't set above 4096 }
     
    12911292    Flags: Cardinal;
    12921293  end;
     1294  PUn = ^TUn;
    12931295
    12941296  { TCity }
     
    13141316    // array value =1 indicates built improvement
    13151317  end;
     1318  PCity = ^TCity;
    13161319
    13171320  TModel = packed record
     
    13521355    Flags: Word;
    13531356  end;
     1357  PUnitInfo = ^TUnitInfo;
    13541358
    13551359  TCityInfo = packed record
     
    13621366    Flags: Word;
    13631367  end;
     1368  PCityInfo = ^TCityInfo;
    13641369
    13651370  TModelInfo = packed record
     
    15911596
    15921597  TTileList = array [0 .. INFIN] of Cardinal;
     1598  PTileList = ^TTileList;
    15931599  TTileObservedLastList = array [0 .. INFIN] of SmallInt;
    15941600  TOwnerList = array [0 .. INFIN] of ShortInt;
     
    16451651    Tribute: array [0 .. nPl - 1] of Integer; // no longer in use
    16461652    TributePaid: array [0 .. nPl - 1] of Integer; // no longer in use
    1647     Wonder: array [0 .. 27] of TWonderInfo;
     1653    Wonder: array [0 .. nWonder - 1] of TWonderInfo;
    16481654    Ship: array [0 .. nPl - 1] of TShipInfo;
    1649     NatBuilt: array [28 .. (nImp + 3) div 4 * 4 - 1] of ShortInt;
     1655    NatBuilt: array [nWonder .. (nImp + 3) div 4 * 4 - 1] of ShortInt;
    16501656    nBattleHistory: Integer;
    16511657    BattleHistory: ^TBattleList; // complete list of all my battles in the whole game
  • trunk/AI/StdAI/ToolAI.pas

    r289 r328  
    234234      Inc(Result, CityReport.FoodRep - CityReport.Eaten);
    235235  end;
    236   for i := 28 to nImp - 1 do
     236  for i := nWonder to nImp - 1 do
    237237    if MyCity[cix].Built[i] > 0 then
    238238      Dec(Result, Imp[i].Maint);
  • trunk/CityProcessing.pas

    r319 r328  
    292292    begin { improvement project }
    293293      result := Imp[Project and cpIndex].Cost;
    294       if (Project and cpIndex < 28) and (GWonder[woColossus].EffectiveOwner = p)
     294      if (Project and cpIndex < nWonder) and (GWonder[woColossus].EffectiveOwner = p)
    295295      then
    296296        result := result * ColossusEffect div 100;
     
    370370          BaseHappiness := Size;
    371371      end;
    372       for i := 0 to 27 do
     372      for i := 0 to nWonder - 1 do
    373373        if Built[i] = 1 then
    374374        begin
     
    773773begin
    774774  with RW[p], City[cix] do
    775     for i := 28 to nImp - 1 do
     775    for i := nWonder to nImp - 1 do
    776776      if (Built[i] > 0) and (Project0 and (cpImp or cpIndex) <> (cpImp or i))
    777777      then // don't pay maintenance when just completed
     
    971971
    972972    // check if wonder already built
    973     if (Project and cpImp <> 0) and (Project and cpIndex < 28) and
     973    if (Project and cpImp <> 0) and (Project and cpIndex < nWonder) and
    974974      (GWonder[Project and cpIndex].CityID <> WonderNotBuiltYet) then
    975975    begin
     
    10501050        end;
    10511051
    1052         if NewImp < 28 then
     1052        if NewImp < nWonder then
    10531053        begin // wonder
    10541054          GWonder[NewImp].CityID := ID;
     
    10601060            woEiffel:
    10611061              begin // reactivate wonders
    1062                 for i := 0 to 27 do
     1062                for i := 0 to nWonder - 1 do
    10631063                  if Imp[i].Expiration >= 0 then
    10641064                    for cix2 := 0 to nCity - 1 do
     
    13031303                dxdy(Loc, Loc1, dx, dy);
    13041304                dec(SubCriterion[(dy + 3) shl 2 + (dx + 3) shr 1], 160);
    1305               end
    1306             end
    1307           end
    1308         end
     1305              end;
     1306            end;
     1307          end;
     1308        end;
    13091309      end;
    13101310
     
    14141414          Hierarchy[iH, iT].Trade := TileInfo.Trade;
    14151415          Hierarchy[iH, iT].SubValue := SubCriterion[V21];
    1416         end
     1416        end;
    14171417      end;
    14181418    if NeedRare <> 0 then
  • trunk/Database.pas

    r319 r328  
    4949  GTestFlags: Integer;
    5050  Mode: TGameMode;
    51   GWonder: array [0 .. 27] of TWonderInfo;
     51  GWonder: array [0 .. nWonder - 1] of TWonderInfo;
    5252  ServerVersion: array [0 .. nPl - 1] of integer;
    5353  ProcessClientData: array [0 .. nPl - 1] of boolean;
     
    452452    ResourceMask[p] := ResourceMask[p] or fModern;
    453453
    454   for i := 0 to 27 do { check whether wonders expired }
     454  for i := 0 to nWonder - 1 do { check whether wonders expired }
    455455    if (GWonder[i].EffectiveOwner <> GWonder[woEiffel].EffectiveOwner) and
    456456      (Imp[i].Expiration = ad) then
     
    31493149  i, j, uix1, cix1, nearest: integer;
    31503150begin
    3151   for i := 0 to 27 do
     3151  for i := 0 to nWonder - 1 do
    31523152    if RW[p].City[cix].Built[i] = 1 then
    31533153    begin
     
    31563156        FreeSlaves;
    31573157      if i = woEiffel then // deactivate expired wonders
    3158         for j := 0 to 27 do
     3158        for j := 0 to nWonder - 1 do
    31593159          if GWonder[j].EffectiveOwner = p then
    31603160            CheckExpiration(j);
    31613161    end;
    3162   for i := 28 to nImp - 1 do
     3162  for i := nWonder to nImp - 1 do
    31633163    if (Imp[i].Kind <> ikCommon) and (RW[p].City[cix].Built[i] > 0) then
    31643164    begin { destroy national projects }
     
    31913191begin
    31923192  StealCity(p, cix, SaveUnits);
    3193   with RW[p].City[cix] do
    3194   begin
    3195     for i := 0 to 27 do
     3193  with RW[p].City[cix] do begin
     3194    for i := 0 to nWonder - 1 do
    31963195      if Built[i] > 0 then
    31973196        GWonder[i].CityID := WonderDestroyed;
     
    32433242    Built[imTownHall] := 0;
    32443243    Built[imCourt] := 0;
    3245     for i := 28 to nImp - 1 do
     3244    for i := nWonder to nImp - 1 do
    32463245      if Imp[i].Kind <> ikCommon then
    32473246        Built[i] := 0; { destroy national projects }
    3248     for i := 0 to 27 do
     3247    for i := 0 to nWonder - 1 do
    32493248      if Built[i] = 1 then
    32503249      begin // new wonder owner!
     
    32523251        if i = woEiffel then // reactivate expired wonders
    32533252        begin
    3254           for j := 0 to 27 do
     3253          for j := 0 to nWonder - 1 do
    32553254            if Imp[j].Expiration >= 0 then
    32563255              for cix1 := 0 to (RW[pNew].nCity - 1) do
    32573256                if RW[pNew].City[cix1].Built[j] = 1 then
    3258                   GWonder[j].EffectiveOwner := pNew
     3257                  GWonder[j].EffectiveOwner := pNew;
    32593258        end
    32603259        else
  • trunk/GameServer.pas

    r326 r328  
    788788
    789789  GTurn := 0;
    790   for i := 0 to 27 do
     790  for i := 0 to nWonder - 1 do
    791791    with GWonder[i] do
    792792    begin
     
    42124212                else if built[NewProject and cpIndex] > 0 then
    42134213                  result := eInvalid
    4214                 else if (NewProject and cpIndex < 28) and
     4214                else if (NewProject and cpIndex < nWonder) and
    42154215                  (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then
    42164216                  result := eViolation // wonder already exists
  • trunk/LocalPlayer/CityScreen.pas

    r325 r328  
    325325    for i := 0 to 29 do
    326326    begin
    327       for iix := 28 to nImp - 1 do
     327      for iix := nWonder to nImp - 1 do
    328328        if (ImpPosition[iix] = i) and (c.Built[iix] > 0) then
    329329        begin
     
    336336    i := 30;
    337337    for iix := 0 to nImp do
    338       if (c.Built[iix] > 0) and ((iix < 28) or (ImpPosition[iix] < 0)) then
     338      if (c.Built[iix] > 0) and ((iix < nWonder) or (ImpPosition[iix] < 0)) then
    339339      begin
    340340        FillRect(Rect(5 + 16 * (i mod 3) + 48 * (i div 18),
     
    350350      if iix <> imTrGoods then
    351351      begin
    352         if (iix >= 28) and (ImpPosition[iix] >= 0) then
     352        if (iix >= nWonder) and (ImpPosition[iix] >= 0) then
    353353          i := ImpPosition[iix];
    354354        if i < 36 then
     
    827827      Cnt := 0;
    828828      for iix := 0 to nImp - 1 do
    829         if ((iix < 28) or (ImpPosition[iix] < 0)) and (c.Built[iix] > 0) then
     829        if ((iix < nWonder) or (ImpPosition[iix] < 0)) and (c.Built[iix] > 0) then
    830830        begin
    831831          i := Cnt - Page * 6;
     
    838838    else
    839839    begin
    840       for iix := 28 to nImp - 1 do
     840      for iix := nWonder to nImp - 1 do
    841841      begin
    842842        i := ImpPosition[iix] - 6 * ZoomArea;
  • trunk/LocalPlayer/CityType.pas

    r188 r328  
    158158
    159159  nPool := 0;
    160   for iix := 28 to nImp - 1 do
     160  for iix := nWonder to nImp - 1 do
    161161    if not(iix in listed) and (Imp[iix].Kind = ikCommon) and (iix <> imTrGoods)
    162162      and (Imp[iix].Preq <> preNA) and
  • trunk/LocalPlayer/ClientTools.pas

    r327 r328  
    261261      Inc(Result, CityReport.FoodSurplus);
    262262  end;
    263   for i := 28 to nImp - 1 do
     263  for i := nWonder to nImp - 1 do
    264264    if MyCity[cix].Built[i] > 0 then
    265265      Dec(Result, Imp[i].Maint);
  • trunk/LocalPlayer/Help.pas

    r318 r328  
    14841484                hkMisc + hkCrossLink, miscGovList);
    14851485          NextSection('BUILDALLOW');
    1486           for i := 0 to 27 do
     1486          for i := 0 to nWonder - 1 do
    14871487            if Imp[i].Preq = no then
    14881488              AddImprovement(i);
    1489           for i := 28 to nImp - 1 do
     1489          for i := nWonder to nImp - 1 do
    14901490            if (Imp[i].Preq = no) and (Imp[i].Kind <> ikCommon) then
    14911491              AddImprovement(i);
    1492           for i := 28 to nImp - 1 do
     1492          for i := nWonder to nImp - 1 do
    14931493            if (Imp[i].Preq = no) and (Imp[i].Kind = ikCommon) then
    14941494              AddImprovement(i);
     
    15271527              end;
    15281528          NextSection('EXPIRATION');
    1529           for i := 0 to 27 do
     1529          for i := 0 to nWonder - 1 do
    15301530            if (Imp[i].Preq <> preNA) and (Imp[i].Expiration = no) then
    15311531              AddImprovement(i);
     
    15451545          List := THyperText.Create;
    15461546          List.OwnsObjects := True;
    1547           for i := 28 to nImp - 1 do
     1547          for i := nWonder to nImp - 1 do
    15481548            if (i <> imTrGoods) and (Imp[i].Preq <> preNA) and
    15491549              (Imp[i].Kind = ikCommon) then
     
    15581558          Caption := HelpText.Lookup('HELPTITLE_UNIQUELIST');
    15591559          // AddLine(HelpText.Lookup('HELPTITLE_UNIQUELIST'),pkSection);
    1560           for i := 28 to nImp - 1 do
     1560          for i := nWonder to nImp - 1 do
    15611561            if (Imp[i].Preq <> preNA) and
    15621562              ((Imp[i].Kind = ikNatLocal) or (Imp[i].Kind = ikNatGlobal)) then
     
    15661566            LineFeed;
    15671567            AddLine(HelpText.Lookup('HELPTITLE_SHIPPARTLIST'),pkSection);
    1568             for i:=28 to nImp-1 do
     1568            for i:= nWonder to nImp-1 do
    15691569            if (Imp[i].Preq<>preNA) and (Imp[i].Kind=ikShipPart) then
    15701570            AddLine(Phrases.Lookup('IMPROVEMENTS',i),pkSmallIcon,i,hkImp,i); }
     
    15741574          Caption := HelpText.Lookup('HELPTITLE_WONDERLIST');
    15751575          // AddLine(HelpText.Lookup('HELPTITLE_WONDERLIST'),pkSection);
    1576           for i := 0 to 27 do
     1576          for i := 0 to nWonder - 1 do
    15771577            if Imp[i].Preq <> preNA then
    15781578              AddLine(Phrases.Lookup('IMPROVEMENTS', i), pkSmallIcon, i,
     
    16001600            AddFeature(mcAcademy);
    16011601          end;
    1602           if (no < 28) and not Phrases2FallenBackToEnglish then
     1602          if (no < nWonder) and not Phrases2FallenBackToEnglish then
    16031603          begin
    16041604            LineFeed;
     
    16461646              [Phrases.Lookup('TERRAIN', 3 * 12 + i)]), pkTer, 3 * 12 + i);
    16471647          end;
    1648           if (no < 28) and (Imp[no].Expiration >= 0) then
     1648          if (no < nWonder) and (Imp[no].Expiration >= 0) then
    16491649          begin
    16501650            NextSection('EXPIRATION');
     
    16561656          end;
    16571657          NextSection('SEEALSO');
    1658           if (no < 28) and (Imp[no].Expiration >= 0) then
     1658          if (no < nWonder) and (Imp[no].Expiration >= 0) then
    16591659            AddImprovement(woEiffel);
    16601660          for i := 0 to nImpReplacement - 1 do
  • trunk/LocalPlayer/Select.pas

    r318 r328  
    10681068        code[0, 0] := cpImp + imTrGoods;
    10691069        Lines[0] := 1;
    1070         for i := 28 to nImp - 1 do
     1070        for i := nWonder to nImp - 1 do
    10711071          if Imp[i].Kind = ikCommon then
    10721072            TryAddImpLine(0, i + cpImp);
    1073         for i := 28 to nImp - 1 do
     1073        for i := nWonder to nImp - 1 do
    10741074          if not(Imp[i].Kind in [ikCommon, ikTrGoods]) and
    10751075            ((MyRO.NatBuilt[i] = 0) or (Imp[i].Kind = ikNatLocal)) then
     
    10831083
    10841084        // wonders
    1085         for i := 0 to 27 do
     1085        for i := 0 to nWonder - 1 do
    10861086          TryAddImpLine(1, i + cpImp);
    10871087
  • trunk/LocalPlayer/Term.pas

    r327 r328  
    458458    EnhancementJobs: TEnhancementJobs;
    459459    ImpOrder: array [0 .. nCityType - 1] of TImpOrder;
    460     ToldWonders: array [0 .. 27] of TWonderInfo;
     460    ToldWonders: array [0 .. nWonder - 1] of TWonderInfo;
    461461    ToldTech: array [0 .. nAdv - 1] of ShortInt;
    462462  end;
     
    469469    DeliveredPrices: TPriceSet;
    470470    ReceivedPrices: TPriceSet;
     471  end;
     472
     473  TCurrentMoveInfo = record
     474    AfterMovePaintRadius: Integer;
     475    AfterAttackExpeller: Integer;
     476    DoShow: Boolean;
     477    IsAlly: Boolean;
    471478  end;
    472479
     
    568575
    569576var
    570   Jump: array [0 .. nPl - 1] of integer;
    571   pTurn, pLogo, UnStartLoc, ToldSlavery: integer;
    572   SmallScreen, GameOK, MapValid, skipped, idle: boolean;
    573 
    574   SaveOption: array of integer;
    575   MiniColors: array [0..11, 0..1] of TColor;
     577  Jump: array [0 .. nPl - 1] of Integer;
     578  pTurn: Integer;
     579  pLogo: Integer;
     580  UnStartLoc: Integer;
     581  ToldSlavery: Integer;
     582  SmallScreen: Boolean;
     583  GameOK: Boolean;
     584  MapValid: Boolean;
     585  Skipped: Boolean;
     586  Idle: Boolean;
     587
     588  SaveOption: array of Integer;
    576589  MainMap: TIsoMap;
    577   CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer;
    578   DoShow, IsAlly: boolean;
    579 end;
     590  CurrentMoveInfo: TCurrentMoveInfo;
    580591
    581592function CityEventName(i: integer): string;
     
    10701081      begin
    10711082        result := false;
    1072         exit
     1083        exit;
    10731084      end;
    10741085      ChosenResearch := ModalSelectDlg.result;
     
    13961407  begin
    13971408    need := false;
    1398     for i := 0 to 27 do
     1409    for i := 0 to nWonder - 1 do
    13991410      if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then
    14001411        need := true;
     
    14921503          $FF - Tribe[i].Color and $FF) * 2;
    14931504        if TestColorDistance < ColorDistance then
    1494           ColorDistance := TestColorDistance
     1505          ColorDistance := TestColorDistance;
    14951506      end;
    14961507    if ColorDistance > BestColorDistance then
    14971508    begin
    14981509      CountBest := 0;
    1499       BestColorDistance := ColorDistance
     1510      BestColorDistance := ColorDistance;
    15001511    end;
    15011512    if ColorDistance = BestColorDistance then
     
    15031514      inc(CountBest);
    15041515      if DelphiRandom(CountBest) = 0 then
    1505         result := j
     1516        result := j;
    15061517    end;
    15071518  end;
     
    15741585        begin
    15751586          MostCost := TestCost;
    1576           IconIndex := imShipComp + i
     1587          IconIndex := imShipComp + i;
    15771588        end;
    15781589      end;
     
    15861597procedure TMainScreen.InitModule;
    15871598var
    1588   x, y, i, j, Domain: integer;
     1599  i, j, Domain: integer;
    15891600begin
    15901601  { search icons for advances: }
     
    16101621              else
    16111622                AdvIcon[i] := 86 + Domain;
    1612       for j := 28 to nImp - 1 do
     1623      for j := nWonder to nImp - 1 do
    16131624        if Imp[j].Preq = i then
    16141625          AdvIcon[i] := j;
    1615       for j := 28 to nImp - 1 do
     1626      for j := nWonder to nImp - 1 do
    16161627        if (Imp[j].Preq = i) and (Imp[j].Kind <> ikCommon) then
    16171628          AdvIcon[i] := j;
     
    16191630        if i = JobPreq[j] then
    16201631          AdvIcon[i] := 84;
    1621       for j := 0 to 27 do
     1632      for j := 0 to nWonder - 1 do
    16221633        if Imp[j].Preq = i then
    16231634          AdvIcon[i] := j;
     
    16371648  TribeNames := tstringlist.Create;
    16381649
    1639   for x := 0 to 11 do
    1640     for y := 0 to 1 do
    1641       MiniColors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y];
    16421650  IsoEngine.Init(InitEnemyModel);
    16431651  if not IsoEngine.ApplyTileSize(TileSize) and (TileSize <> tsMedium) then
     
    20492057    end;
    20502058
    2051     for i := 0 to 27 do
     2059    for i := 0 to nWonder - 1 do
    20522060    begin
    20532061      OwnWonder := false;
     
    22212229          if (MyRO.Turn > 0) and (Loc >= 0) and (Flags and chCaptured = 0) and
    22222230            (WondersOnly = (Flags and chProduction <> 0) and
    2223             (Project0 and cpImp <> 0) and (Project0 and cpIndex < 28)) then
     2231            (Project0 and cpImp <> 0) and (Project0 and cpIndex < nWonder)) then
    22242232          begin
    22252233            if WondersOnly then
     
    26022610                  inc(ToldAlive, 1 shl i);
    26032611              PeaceEvaHappened := 0;
    2604               for i := 0 to 27 do
     2612              for i := 0 to nWonder - 1 do
    26052613                with ToldWonders[i] do
    26062614                begin
     
    58525860    if CityCaptured and (MyMap[ToLoc] and fCity = 0) then
    58535861    begin // city destroyed
    5854       for i := 0 to 27 do { tell about destroyed wonders }
     5862      for i := 0 to nWonder - 1 do { tell about destroyed wonders }
    58555863        if (MyRO.Wonder[i].CityID = WonderDestroyed) and (MyData.ToldWonders[i].CityID <> WonderDestroyed)
    58565864        then
     
    58745882    begin // city captured
    58755883      ListDlg.AddCity;
    5876       for i := 0 to 27 do { tell about capture of wonders }
     5884      for i := 0 to nWonder - 1 do { tell about capture of wonders }
    58775885        if MyRO.City[MyRO.nCity - 1].Built[i] > 0 then
    58785886          with MessgExDlg do
     
    71837191      // check if city types already usefull:
    71847192      if MyRO.nCity > 0 then
    7185         for i := 28 to nImp - 1 do
     7193        for i := nWonder to nImp - 1 do
    71867194          if (i <> imTrGoods) and (Imp[i].Kind = ikCommon) and
    71877195            (Imp[i].Preq <> preNA) and
     
    72627270    mEUnitStat.Enabled := MyRO.nEnemyModel > 0;
    72637271    { mWonders.Enabled:= false;
    7264       for i:=0 to 27 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then
     7272      for i:=0 to nWonder - 1 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then
    72657273      mWonders.Enabled:=true; }
    72667274    mDiagram.Enabled := MyRO.Turn >= 2;
  • trunk/Protocol.pas

    r326 r328  
    1111  nImp = 70; { number of improvements }
    1212  nPl = 15; { max number of players, don't change! }
     13  nWonder = 28; { number of wonders }
    1314  nUmax = 4096; { max units/player, don't set above 4096 }
    1415  nCmax = 1024; { max cities/player, don't set above 4096 }
     
    16501651    Tribute: array [0 .. nPl - 1] of Integer; // no longer in use
    16511652    TributePaid: array [0 .. nPl - 1] of Integer; // no longer in use
    1652     Wonder: array [0 .. 27] of TWonderInfo;
     1653    Wonder: array [0 .. nWonder - 1] of TWonderInfo;
    16531654    Ship: array [0 .. nPl - 1] of TShipInfo;
    1654     NatBuilt: array [28 .. (nImp + 3) div 4 * 4 - 1] of ShortInt;
     1655    NatBuilt: array [nWonder .. (nImp + 3) div 4 * 4 - 1] of ShortInt;
    16551656    nBattleHistory: Integer;
    16561657    BattleHistory: ^TBattleList; // complete list of all my battles in the whole game
  • trunk/UMiniMap.pas

    r327 r328  
    312312          else if moPolitical in MapOptions then begin
    313313            // Political
    314             if MyMap[Loc] and fTerrain < fGrass then
    315               cm := cmPolOcean
    316             else if MyRO.Territory[Loc] < 0 then
    317               cm := cmPolNone
    318             else
    319               cm := Tribe[MyRO.Territory[Loc]].Color;
     314            if MyMap[Loc] and fTerrain < fGrass then cm := cmPolOcean
     315            else if MyRO.Territory[Loc] < 0 then cm := cmPolNone
     316            else cm := Tribe[MyRO.Territory[Loc]].Color;
    320317          end;
    321318          MiniPixel.Pixel^.B := (cm shr 16) and $ff;
Note: See TracChangeset for help on using the changeset viewer.