anchor.diff:  
       //Avoid repeated computing (+2% performance)
       I1 := max(Pos.Y-aRadius, 0);
  -    I2 := min(Pos.Y+aRadius, MapY-1);
  +    I2 := min(Pos.Y+aRadius, fMapY-1);
       K1 := max(Pos.X-aRadius, 0);
  -    K2 := min(Pos.X+aRadius, MapX-1);
  +    K2 := min(Pos.X+aRadius, fMapX-1);
       SqrRadius := Sqr(aRadius);
   
       //Inline maths here to gain performance
  
positive.code: procedure TKMFogOfWar.SyncFOW(aFOW: TKMFogOfWar);
  var I,K: Word;
  begin
    for I := 0 to MapY - 1 do
      for K := 0 to MapX - 1 do
      begin
        Revelation[I, K] := Max(Revelation[I, K], aFOW.Revelation[I, K]);
        RenderRevelation[I, K] := Max(RenderRevelation[I, K], aFOW.RenderRevelation[I, K]);
  
negative.code: //but false in cases where it will effect the gameplay (e.g. unit hit test)
  function TKMFogOfWar.CheckTileRev(aRevArray: PKMByte2Array; const X,Y: Word): Byte;
  begin
    if (X <= 0) or (X >= fMapX)
      or (Y <= 0) or (Y >= fMapY) then
    begin
      Result := 0;
      Exit;
  