Ignore:
Timestamp:
Jan 7, 2024, 10:24:51 PM (4 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
  • Added: High DPI aware SetWindowPos function.
File:
1 edited

Legend:

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

    r486 r522  
    762762          begin
    763763            Inc(BestCount);
    764             if random(BestCount) = 0 then
     764            if Random(BestCount) = 0 then
    765765            begin
    766766              PatrolScore := TestScore;
     
    888888  var
    889889    I, F, uix, Loc1, A, B: Integer;
    890     ready, go: Boolean;
     890    Ready, Go: Boolean;
    891891    TransportPlan: TGroupTransportPlan;
    892892  begin
    893     go := False;
     893    Go := False;
    894894    for F := 0 to maxCOD - 1 do
    895895      if (F < nContinent) and (ContinentPresence[F] and not
    896896        (1 shl Me or PresenceUnknown) <> 0) then
    897         go := True; // any enemy island known?
    898     if not go then
     897        Go := True; // any enemy island known?
     898    if not Go then
    899899      Exit;
    900900
    901901    SeaTransport_BeginInitialize;
    902     go := False;
     902    Go := False;
    903903    for uix := 0 to RO.nUn - 1 do
    904904      if not Moved[uix] then
     
    915915            end;
    916916          end;
    917     if go then
     917    if Go then
    918918    begin
    919       go := False;
     919      Go := False;
    920920      for uix := 0 to RO.nUn - 1 do
    921921        if not Moved[uix] then
     
    928928            end;
    929929    end;
    930     if go then
     930    if Go then
    931931      for Loc1 := 0 to MapSize - 1 do
    932932        if Map[Loc1] and fTerrain >= fGrass then
     
    941941    begin
    942942      Moved[TransportPlan.uixTransport] := True;
    943       ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;
    944       if not ready then
     943      Ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;
     944      if not Ready then
    945945      begin
    946946        Unit_MoveEx(TransportPlan.uixTransport, TransportPlan.LoadLoc);
    947         ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;
    948       end;
    949       if ready then
     947        Ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;
     948      end;
     949      if Ready then
    950950        for I := 0 to TransportPlan.nLoad - 1 do
    951951        begin
    952952          Loc_to_ab(TransportPlan.LoadLoc,
    953953            MyUnit[TransportPlan.uixLoad[I]].Loc, A, B);
    954           ready := ready and (abs(A) <= 1) and (abs(B) <= 1);
    955         end;
    956       if ready then
     954          Ready := Ready and (Abs(A) <= 1) and (Abs(B) <= 1);
     955        end;
     956      if Ready then
    957957      begin
    958958        for I := 0 to TransportPlan.nLoad - 1 do
     
    16461646      begin
    16471647        Inc(nPreq);
    1648         if random(nPreq) = 0 then
     1648        if Random(nPreq) = 0 then
    16491649          ChosenPreq := ad;
    16501650      end;
     
    17361736  I := 0;
    17371737  while (I < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[I] < 0) or
    1738       IsResearched(abs(ResearchOrder[I]))) do
     1738      IsResearched(Abs(ResearchOrder[I]))) do
    17391739    Inc(I);
    17401740  if I >= nResearchOrder then // list done, continue with future tech
    17411741  begin
    1742     if random(2) = 1 then
     1742    if Random(2) = 1 then
    17431743      Result := futArtificialIntelligence
    17441744    else
     
    17501750    nPreq := 0;
    17511751    ChosenPreq := -1;
    1752     ChoosePreq(abs(ResearchOrder[I]));
     1752    ChoosePreq(Abs(ResearchOrder[I]));
    17531753    Assert(nPreq > 0);
    17541754    Result := ChosenPreq;
Note: See TracChangeset for help on using the changeset viewer.