Changeset 45


Ignore:
Timestamp:
Jan 10, 2017, 12:11:21 AM (8 years ago)
Author:
chronos
Message:
  • Fixed: Range check error in territory borders evaluation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r44 r45  
    10811081
    10821082begin
    1083   FillChar(RealMap, MapSize * 4, 0);
     1083  FillChar(RealMap, MapSize * SizeOf(Cardinal), 0);
    10841084  plus := 0;
    10851085  bMountains := 256;
     
    27982798// player's territory, -1 for full border recalculation
    27992799var
    2800   i, r, Loc, Loc1, dx, dy, p1, p2, cix, NewDist, dxMax, dyMax, OldOwner, V8,
    2801     NewOwner: integer;
     2800  i, r, Loc, Loc1, dx, dy, p1, p2, cix, NewDist, dxMax, dyMax, OldOwner, V8: Integer;
     2801  NewOwner: Cardinal;
    28022802  Adjacent: TVicinity8Loc;
    28032803  AtPeace: array [0 .. nPl, 0 .. nPl] of boolean;
     
    29072907              else
    29082908                ChangeTerritory(Loc, NewOwner);
    2909             inc(BorderChanges[i div 8], NewOwner shl (i mod 8 * 4));
     2909            BorderChanges[i shr 3] := BorderChanges[i shr 3] or
     2910              ((NewOwner shl ((i and 7) * 4)) and $ffffffff);
    29102911          end;
    29112912          inc(i);
    2912         end
    2913     end
     2913        end;
     2914    end;
    29142915  end
    29152916  else
Note: See TracChangeset for help on using the changeset viewer.