Changeset 186


Ignore:
Timestamp:
May 6, 2020, 8:48:39 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Code formatting.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r144 r186  
    957957    end;
    958958    if (RealMap[Loc] xor Cardinal(OldTile)) and fTerrain <> 0 then
    959       result := true
     959      result := true;
    960960  end;
    961961end;
     
    991991    begin
    992992      z0 := 6 * y div ly;
    993       ZPlus := 6 * y / ly - z0
     993      ZPlus := 6 * y / ly - z0;
    994994    end
    995995    else
    996996    begin
    997997      z0 := 6 * (ly - 1 - y) div ly;
    998       ZPlus := 6 * (ly - 1 - y) / ly - z0
     998      ZPlus := 6 * (ly - 1 - y) / ly - z0;
    999999    end;
    10001000    p0 := 1;
     
    10061006      begin
    10071007        RndLow := i;
    1008         Break
    1009       end;
    1010       p0 := p0 - p
     1008        Break;
     1009      end;
     1010      p0 := p0 - p;
    10111011    end;
    10121012  end;
     
    10531053            Cost := 0;
    10541054          if Q.Put(Loc1, T + Cost shl 8 + 1) then
    1055             From[Loc1] := Loc
    1056         end
    1057       end
     1055            From[Loc1] := Loc;
     1056        end;
     1057      end;
    10581058    end;
    10591059    Loc1 := Loc;
     
    10751075        else if RealMap[Loc] and fTerrain >= fGrass then
    10761076          RealMap[Loc] := RealMap[Loc] or fRiver;
    1077       end
     1077      end;
    10781078    end
    10791079    else
    10801080      result := 0;
    1081     Q.Free
     1081    Q.Free;
    10821082  end;
    10831083
     
    14041404            CityLoc[c, nCityLoc[c]] := Loc;
    14051405            inc(nCityLoc[c])
    1406           end
    1407         end
     1406          end;
     1407        end;
    14081408      end;
    14091409      Loc := (Loc + 1) * primitive mod (MapSize + 1) - 1;
     
    15371537      IrrLoc[j] := IrrLoc[nIrrLoc - 1];
    15381538      dec(nIrrLoc);
    1539       dec(i)
     1539      dec(i);
    15401540    end;
    15411541  end;
     
    15901590            StartLoc2[p1] := Loc1;
    15911591        end;
    1592       end
     1592      end;
    15931593    end;
    15941594end; { StartPositions }
     
    17951795  StartPositions;
    17961796  InitGame;
    1797 end; { InitRandomGame }
     1797end;
    17981798
    17991799procedure InitMapGame(Human: integer);
     
    18031803  PredefinedStartPositions(Human);
    18041804  InitGame;
    1805 end; { InitMapGame }
     1805end;
    18061806
    18071807procedure ReleaseGame;
     
    18241824      FreeMem(RW[p1].MapObservedLast);
    18251825      FreeMem(RW[p1].Map);
    1826     end
     1826    end;
    18271827end;
    18281828
     
    19441944      begin
    19451945        result := eNoPreq;
    1946         exit
     1946        exit;
    19471947      end;
    19481948    end;
     
    19581958    begin
    19591959      result := eInvalid;
    1960       exit
     1960      exit;
    19611961    end; // no city found here
    19621962
     
    21142114          Det := TestDet;
    21152115          Cost := TestCost;
    2116         end
    2117       end
    2118     end
     2116        end;
     2117      end;
     2118    end;
    21192119  end;
    21202120end;
     
    21782178                UnitReport.ReportFlags := UnitReport.ReportFlags or urfDeployed;
    21792179          end;
    2180         end
     2180        end;
    21812181      end;
    21822182    end;
     
    23732373          end
    23742374          else
    2375             AddFlags := AddFlags or Map[Loc] and (fStealthUnit or fHiddenUnit)
    2376         end
     2375            AddFlags := AddFlags or Map[Loc] and (fStealthUnit or fHiddenUnit);
     2376        end;
    23772377    end; // if Mode>moLoading_Fast
    23782378
     
    24312431    ObserveLevel[Loc] := ObserveLevel[Loc] and not(3 shl (2 * pTell)) or
    24322432      Cardinal(Level) shl (2 * pTell);
    2433   end
     2433  end;
    24342434end; // DiscoverTile
    24352435
     
    24602460              result := DiscoverTile(Loc1, p, pTell, Level, EnableContact)
    24612461                or result;
    2462           end
     2462          end;
    24632463      end
    24642464      else
     
    24672467        if Level > OldLevel then
    24682468          result := DiscoverTile(Loc1, p, p, Level, EnableContact) or result;
    2469       end
     2469      end;
    24702470  end;
    24712471end;
     
    25002500              result := DiscoverTile(Loc1, p, pTell, Level, EnableContact)
    25012501                or result;
    2502           end
     2502          end;
    25032503      end
    25042504      else
     
    25072507        if Level > OldLevel then
    25082508          result := DiscoverTile(Loc1, p, p, Level, EnableContact) or result;
    2509       end
     2509      end;
    25102510    end;
    25112511    AdjacentFlags := AdjacentFlags shr 1;
     
    25702570            RW[pTell].EnemyCity[ecix].Loc := -1;
    25712571            RW[pTell].Map[Loc] := RW[pTell].Map[Loc] and not fCity
    2572           end
    2573         end
    2574       end
     2572          end;
     2573        end;
     2574      end;
    25752575    end;
    25762576end;
     
    25942594        RWemix[p, Occupant[Loc], unx.mix];
    25952595      inc(result);
    2596     end
    2597   end
     2596    end;
     2597  end;
    25982598end;
    25992599
     
    26552655            ClearFlags := ClearFlags or fOwnZoCUnit;
    26562656          RW[p].Map[Loc] := RW[p].Map[Loc] and not ClearFlags or AddFlags;
    2657         end
    2658       end
    2659     end
     2657        end;
     2658      end;
     2659    end;
    26602660end;
    26612661
     
    26912691            Tile1^ := Tile1^ or fInEnemyZoC;
    26922692            Break
    2693           end
    2694         end
    2695       end;
    2696     end
    2697   end
     2693          end;
     2694        end;
     2695      end;
     2696    end;
     2697  end;
    26982698end;
    26992699
     
    27212721          if (Loc1 >= 0) and (Loc1 < MapSize) then
    27222722            RW[p].Map[Loc1] := RW[p].Map[Loc1] or fInEnemyZoC
    2723         end
    2724       end
    2725     end
     2723        end;
     2724      end;
     2725    end;
    27262726end;
    27272727
     
    27402740  for Loc := 0 to MapSize - 1 do
    27412741    if PeacePlayer[RW[p].Territory[Loc]] then
    2742       RW[p].Map[Loc] := RW[p].Map[Loc] or fPeace
     2742      RW[p].Map[Loc] := RW[p].Map[Loc] or fPeace;
    27432743end;
    27442744
     
    27542754  p1: integer;
    27552755begin
    2756   assert(p >= 0); // no player's territory indicated by p=nPl
    2757   dec(TerritoryCount[RealMap[Loc] shr 27]);
    2758   inc(TerritoryCount[p]);
     2756  Assert(p >= 0); // no player's territory indicated by p=nPl
     2757  Dec(TerritoryCount[RealMap[Loc] shr 27]);
     2758  Inc(TerritoryCount[p]);
    27592759  RealMap[Loc] := RealMap[Loc] and not($F shl 27) or Cardinal(p) shl 27;
    27602760  if p = $F then
     
    27702770        else
    27712771          RW[p1].Map[Loc] := RW[p1].Map[Loc] and not fPeace;
    2772       end
     2772      end;
    27732773end;
    27742774
     
    27972797          ChangeTerritory(Loc, NewOwner);
    27982798        inc(i);
    2799       end
    2800   end
     2799      end;
     2800  end;
    28012801end;
    28022802
     
    28392839            then
    28402840              StolenDist[Loc1] := NewDist;
    2841           end
    2842         end
     2841          end;
     2842        end;
    28432843    end;
    28442844  end;
     
    28752875            Country[Loc1] := FormerCountry[Loc];
    28762876            Dist[Loc1] := NewDist;
    2877           end
    2878         end
    2879       end
     2877          end;
     2878        end;
     2879      end;
    28802880  end;
    28812881
     
    30263026    if RW[p].Model[mix].Flags and mdZOC <> 0 then
    30273027      ZoCMap[Loc] := 1;
    3028   end
     3028  end;
    30293029end;
    30303030
    30313031procedure CountLost(p, mix, Enemy: integer);
    30323032begin
    3033   inc(RW[p].Model[mix].Lost);
     3033  Inc(RW[p].Model[mix].Lost);
    30343034  TellAboutModel(Enemy, p, mix);
    3035   inc(Destroyed[Enemy, p, mix]);
     3035  Inc(Destroyed[Enemy, p, mix]);
    30363036end;
    30373037
     
    30643064    if Enemy >= 0 then
    30653065      CountLost(p, mix, Enemy);
    3066   end
    3067 end; { RemoveUnit }
     3066  end;
     3067end;
    30683068
    30693069procedure RemoveUnit_UpdateMap(p, uix: integer);
    30703070var
    3071   Loc0: integer;
     3071  Loc0: Integer;
    30723072begin
    30733073  Loc0 := RW[p].Un[uix].Loc;
     
    31383138    ChangeTerritory(Loc, p)
    31393139  end;
    3140 end; { FoundCity }
     3140end;
    31413141
    31423142procedure StealCity(p, cix: integer; SaveUnits: boolean);
     
    31783178        else
    31793179          RemoveUnit(p, uix1); // destroy supported units
    3180 end; // StealCity
     3180end;
    31813181
    31823182procedure DestroyCity(p, cix: integer; SaveUnits: boolean);
     
    31973197    RealMap[Loc] := RealMap[Loc] and not fCity;
    31983198    Loc := -1
    3199   end
    3200 end; // DestroyCity
     3199  end;
     3200end;
    32013201
    32023202procedure ChangeCityOwner(pOld, cixOld, pNew: integer);
     
    32753275    ChangeTerritory(Loc, pNew);
    32763276  end;
    3277 end; // ChangeCityOwner
     3277end;
    32783278
    32793279procedure CompleteJob(p, Loc, Job: integer);
     
    34113411      if RW[pAbout].Un[uix].Loc >= 0 then
    34123412        inc(UnCount[RW[pAbout].Un[uix].mix]);
    3413   end
     3413  end;
    34143414end;
    34153415
     
    34263426      begin
    34273427      end; }
    3428   end
     3428  end;
    34293429end;
    34303430
     
    34473447    rTarget.ResearchTech := rSender.ResearchTech;
    34483448    rTarget.ResearchDone := rSender.ResearchDone;
    3449     result := true
     3449    result := true;
    34503450  end;
    34513451  for i := 0 to nAdv - 1 do
     
    34533453    begin
    34543454      rTarget.Tech[i] := rSender.Tech[i];
    3455       result := true
    3456     end
     3455      result := true;
     3456    end;
    34573457end;
    34583458
     
    34743474    for mix := 0 to rTarget.nModelCounted - 1 do
    34753475      TellAboutModel(pTarget, pAbout, mix);
    3476     result := true
    3477   end
     3476    result := true;
     3477  end;
    34783478end;
    34793479
     
    34913491    MakeModelInfo(pTarget, i, RW[pTarget].Model[i], miTarget);
    34923492    if IsSameModel(miSender, miTarget) then
    3493       ok := false
     3493      ok := false;
    34943494  end;
    34953495  if ok then
     
    35093509    inc(Researched[pTarget]);
    35103510    TellAboutModel(pSender, pTarget, RW[pTarget].nModel - 1);
    3511   end
     3511  end;
    35123512end;
    35133513
     
    36623662            RecalcPeaceMap(pSender);
    36633663            RecalcPeaceMap(pTarget);
    3664           end
    3665         end
     3664          end;
     3665        end;
    36663666      end;
    36673667    opShipParts: // + number + part type shl 16
     
    36813681              RW[pSender].Ship[pTarget].Parts[i] := GShip[pTarget].Parts[i];
    36823682              RW[pTarget].Ship[pTarget].Parts[i] := GShip[pTarget].Parts[i];
    3683             end
    3684           end
     3683            end;
     3684          end;
    36853685        end
    36863686        else
     
    36953695          dec(RW[pSender].Money, Price - opMoney);
    36963696          inc(RW[pTarget].Money, Price - opMoney);
    3697         end
     3697        end;
    36983698      end
    36993699      else
     
    37103710          SeeTech(pTarget, Price - opTech);
    37113711          RW[pSender].EnemyReport[pTarget].Tech[Price - opTech] := tsSeen;
    3712         end
     3712        end;
    37133713      end
    37143714      else
     
    38073807      RecalcMapZoC(p);
    38083808      RecalcMapZoC(pWith);
    3809     end
     3809    end;
    38103810  end;
    38113811  if OldTreaty in [trPeace, trAlliance] then
     
    38133813    RecalcPeaceMap(p);
    38143814    RecalcPeaceMap(pWith);
    3815   end
     3815  end;
    38163816end;
    38173817
     
    38543854              if CopyMilReport(pCity, p, p1) then
    38553855                result := result or (2 shl (2 * p1));
    3856           end
     3856          end;
    38573857      end;
    38583858  end;
     
    39113911              if RW[p2].EnemyReport[p1].Tech[AgePreq[i]] < tsApplicable then
    39123912                RW[p2].EnemyReport[p1].Tech[AgePreq[i]] := tsCheat;
    3913       end
     3913      end;
    39143914    end;
    39153915
     
    39253925          GiveCivilReport(p, p1);
    39263926          GiveMilReport(p, p1);
    3927         end
    3928       end
     3927        end;
     3928      end;
    39293929  end;
    39303930end;
  • trunk/LocalPlayer/IsoEngine.pas

    r182 r186  
    55
    66uses
    7   Protocol, ClientTools, ScreenTools, Tribes,
    8 {$IFNDEF SCR}Term, {$ENDIF}
     7  Protocol, ClientTools, ScreenTools, Tribes, {$IFNDEF SCR}Term, {$ENDIF}
    98  LCLIntf, LCLType, SysUtils, Classes, Graphics, PixelPointer;
    109
     
    478477  begin
    479478    Width := Width - (FLeft - x);
    480     x := FLeft
     479    x := FLeft;
    481480  end;
    482481  if y < FTop then
    483482  begin
    484483    Height := Height - (FTop - y);
    485     y := FTop
     484    y := FTop;
    486485  end;
    487486  if x + Width >= FRight then
     
    510509    Width := Width - (FLeft - x);
    511510    xSrc := xSrc + (FLeft - x);
    512     x := FLeft
     511    x := FLeft;
    513512  end;
    514513  if y < FTop then
     
    516515    Height := Height - (FTop - y);
    517516    ySrc := ySrc + (FTop - y);
    518     y := FTop
     517    y := FTop;
    519518  end;
    520519  if x + Width >= FRight then
     
    628627          TSprite(x,y+16,12*9+7); }
    629628        Sprite(HGrStdUnits, x, y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1);
    630       end
    631     end
     629      end;
     630    end;
    632631end; { PaintUnit }
    633632
Note: See TracChangeset for help on using the changeset viewer.