Ignore:
Timestamp:
Dec 8, 2023, 11:39:45 PM (5 months ago)
Author:
chronos
Message:
  • Added: Range checking for TPixelPointer record type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Select.pas

    r486 r487  
    275275        begin // city size
    276276          Brush.Color := $000000;
    277           FillRect(rect(X - 4 - 11, Y + 1, X - 4 + 13, Y + 21));
     277          FillRect(Rect(X - 4 - 11, Y + 1, X - 4 + 13, Y + 21));
    278278          Brush.Color := $FFFFFF;
    279           FillRect(rect(X - 4 - 12, Y, X - 4 + 12, Y + 20));
     279          FillRect(Rect(X - 4 - 12, Y, X - 4 + 12, Y + 20));
    280280          Brush.Style := TBrushStyle.bsClear;
    281281          Font.Color := $000000;
     
    286286      if Kind = kCityEvents then
    287287      begin
    288         first := -1;
     288        First := -1;
    289289        for J := 0 to nCityEventPriority - 1 do
    290290          if (Flags and CityRepMask and CityEventPriority[J] <> 0) then
    291291          begin
    292             first := J;
     292            First := J;
    293293            Break;
    294294          end;
    295         if first >= 0 then
     295        if First >= 0 then
    296296        begin
    297297          I := 0;
    298298          Test := 1;
    299           while Test < CityEventPriority[first] do
     299          while Test < CityEventPriority[First] do
    300300          begin
    301301            Inc(I);
     
    303303          end;
    304304          S := CityEventName(I);
    305           { if CityEventPriority[first]=chNoGrowthWarning then
    306             if Built[imAqueduct]=0 then
    307             S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imAqueduct)])
    308             else begin S:=Format(S,[Phrases.Lookup('IMPROVEMENTS',imSewer)]); I:=17 end; }
     305          { if CityEventPriority[First] = chNoGrowthWarning then
     306            if Built[imAqueduct] = 0 then
     307            S := Format(S, [Phrases.Lookup('IMPROVEMENTS', imAqueduct)])
     308            else begin S := Format(S, [Phrases.Lookup('IMPROVEMENTS', imSewer)]); I := 17 end; }
    309309          ReplaceText(X + (CityNameSpace + 4 + 40 + 18 + 8), Y, TextColor, S);
    310310          if NonText then
     
    313313              y0 + 1, 18, 18, 1 + I mod 3 * 19, 1 + I div 3 * 19);
    314314            X := InnerWidth - 26;
    315             for J := nCityEventPriority - 1 downto first + 1 do
     315            for J := nCityEventPriority - 1 downto First + 1 do
    316316              if (Flags and CityRepMask and CityEventPriority[J] <> 0) then
    317317              begin
Note: See TracChangeset for help on using the changeset viewer.