anchor.diff:      else        begin RadLeft:=0; RadRight:=0; RadTop:= 0; RadBottom:=0; R1:=  0; R2:=  0; R3:=  0; R4:=  0; end;
     end;
   
  -  for i:=max(aPosition.Y-RadTop,1) to min(aPosition.Y+RadBottom,fMapY-1) do
  -  for k:=max(aPosition.X-RadLeft,1) to min(aPosition.X+RadRight,fMapX-1) do
  -  begin
  -    if Land[i,k].Terrain = R1 then begin if InRange(i,aPosition.Y-RadTop +2,aPosition.Y+RadBottom-2) then
  -                                         if InRange(k,aPosition.X-RadLeft+2,aPosition.X+RadRight -2) then
  +  for i:=max(aLoc.Y-RadTop,1) to min(aLoc.Y+RadBottom,fMapY-1) do
  +  for k:=max(aLoc.X-RadLeft,1) to min(aLoc.X+RadRight,fMapX-1) do
  +  begin
  +    if Land[i,k].Terrain = R1 then begin if InRange(i,aLoc.Y-RadTop +2,aLoc.Y+RadBottom-2) then
  +                                         if InRange(k,aLoc.X-RadLeft+2,aLoc.X+RadRight -2) then
                                            L[1].AddEntry(KMPoint(k,i)) end else
  -    if Land[i,k].Terrain = R2 then begin if InRange(i,aPosition.Y-RadTop +1,aPosition.Y+RadBottom-1) then
  -                                         if InRange(k,aPosition.X-RadLeft+1,aPosition.X+RadRight -1) then
  +    if Land[i,k].Terrain = R2 then begin if InRange(i,aLoc.Y-RadTop +1,aLoc.Y+RadBottom-1) then
  +                                         if InRange(k,aLoc.X-RadLeft+1,aLoc.X+RadRight -1) then
                                            L[2].AddEntry(KMPoint(k,i)) end else
       if Land[i,k].Terrain = R3 then L[3].AddEntry(KMPoint(k,i)) else //Always mine second richest ore, it is never left in KaM
       if Land[i,k].Terrain = R4 then L[4].AddEntry(KMPoint(k,i));     //Always mine richest ore
  
positive.code: 
  {Find seaside}
  {Return walkable tile nearby}
  function TTerrain.FindFishWater(aPosition:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out FishPoint: TKMPointDir):Boolean;
  const Ins=2; //2..Map-2
  var i,k,j,l:integer; List:TKMPointDirList;
  begin
  
negative.code: end;
  
  
  function TTerrain.ChooseTreeToPlant(aLoc:TKMPoint):integer;
  begin
    //This function randomly chooses a tree object based on the terrain type. Values matched to KaM, using all soil tiles.
    case Land[aLoc.Y,aLoc.X].Terrain of
      0..3,5,6,8,9,11,13,14,18,19,56,57,66..69,72..74,84..86,93..98,180,188: Result := ChopableTrees[1+KaMRandom(7),1]; //Grass (oaks, etc.)
      26..28,75..80,182,190:                                                 Result := ChopableTrees[7+KaMRandom(2),1]; //Yellow dirt
      16,17,20,21,34..39,47,49,58,64,65,87..89,183,191,220,247:              Result := ChopableTrees[9+KaMRandom(5),1]; //Brown dirt (pine trees)
  