anchor.diff:      function CheckHeightPass(aLoc:TKMPoint; aPass:TPassability):boolean;
       procedure AddHouseRemainder(Loc:TKMPoint; aHouseType:THouseType; aBuildState:THouseBuildState);
   
  -    function FindField(aPosition:TKMPoint; aRadius:integer; aFieldType:TFieldType; aAgeFull:boolean; aAvoidLoc:TKMPoint; out FieldPoint:TKMPointDir):Boolean;
  -    function FindTree(aPosition:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out TreePoint: TKMPointDir):Boolean;
  -    function FindStone(aPosition:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out StonePoint: TKMPointDir):Boolean;
  -    function FindOre(aPosition:TKMPoint; Rt:TResourceType; out OrePoint: TKMPoint):Boolean;
  -    function FindPlaceForTree(aPosition:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out TreePlacePoint: TKMPointDir):Boolean;
  -    function FindFishWater(aPosition:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out FishPoint: TKMPointDir):Boolean;
  -    function CanFindFishingWater(aPosition:TKMPoint; aRadius:integer):boolean;
  -    function ChooseTreeToPlant(aPosition:TKMPoint):integer;
  -    procedure GetHouseMarks(aPosition:TKMPoint; aHouseType:THouseType; aList:TKMPointTagList);
  -
  -    function WaterHasFish(aPosition:TKMPoint):boolean;
  -    function CatchFish(aPosition:TKMPointDir; TestOnly:boolean=false):boolean;
  +    function FindField(aLoc:TKMPoint; aRadius:integer; aFieldType:TFieldType; aAgeFull:boolean; aAvoidLoc:TKMPoint; out FieldPoint:TKMPointDir):Boolean;
  +    function FindTree(aLoc:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out TreePoint: TKMPointDir):Boolean;
  +    function FindStone(aLoc:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out StonePoint: TKMPointDir):Boolean;
  +    function FindOre(aLoc:TKMPoint; Rt:TResourceType; out OrePoint: TKMPoint):Boolean;
  +    function FindPlaceForTree(aLoc:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out TreePlacePoint: TKMPointDir):Boolean;
  +    function FindFishWater(aLoc:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out FishPoint: TKMPointDir):Boolean;
  +    function CanFindFishingWater(aLoc:TKMPoint; aRadius:integer):boolean;
  +    function ChooseTreeToPlant(aLoc:TKMPoint):integer;
  +    procedure GetHouseMarks(aLoc:TKMPoint; aHouseType:THouseType; aList:TKMPointTagList);
  +
  +    function WaterHasFish(aLoc:TKMPoint):boolean;
  +    function CatchFish(aLoc:TKMPointDir; TestOnly:boolean=false):boolean;
   
       procedure SetTree(Loc:TKMPoint; ID:integer);
       procedure FallTree(Loc:TKMPoint);
  
positive.code: end;
  
  
  function TTerrain.ChooseTreeToPlant(aPosition: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[aPosition.Y,aPosition.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)
  
negative.code: 
  {Find closest harvestable deposit of Stone}
  {Return walkable tile below Stone deposit}
  function TTerrain.FindStone(aLoc:TKMPoint; aRadius:integer; aAvoidLoc:TKMPoint; out StonePoint: TKMPointDir):Boolean;
  const Ins=1; //1..Map-1
  var i,k:integer; List:TKMPointDirList;
  begin
    List := TKMPointDirList.Create;
    for i:=max(aLoc.Y-aRadius,Ins) to min(aLoc.Y+aRadius,fMapY-Ins-1) do //Leave one more tile below, where Stoncutter will stand
    for k:=max(aLoc.X-aRadius,Ins) to min(aLoc.X+aRadius,fMapX-Ins) do
      if (KMLength(aLoc,KMPoint(k,i))<=aRadius) and not KMSamePoint(aAvoidLoc,KMPoint(k,i+1)) then
        if (TileIsStone(k,i)>0) then
          if (CanWalk in Land[i+1,k].Passability) then //Now check the tile right below
            if Route_CanBeMade(aLoc,KMPoint(k,i+1),CanWalk,0,false) then
              List.AddEntry(KMPointDir(KMPoint(k,i+1), dir_N));
  
    Result := List.GetRandom(StonePoint);
  