anchor.diff:      function GetSourceLocation(aHouseType: array of THouseType; out Loc: TKMPoint): Boolean;
   
       function NextToOre(aHouse: THouseType; aOreType: TResourceType; out aLoc: TKMPoint): Boolean;
  -    function NextToHouse(aTarget: array of THouseType; aHouse: THouseType; out aLoc: TKMPoint): Boolean;
  +    function NextToHouse(aHouse: THouseType; aTarget, aAvoid: array of THouseType; out aLoc: TKMPoint): Boolean;
       function NextToStone(out aLoc: TKMPoint): Boolean;
       function NextToTrees(aTarget: array of THouseType; aHouse: THouseType; out aLoc: TKMPoint): Boolean;
       function NextToGrass(aTarget, aHouse: THouseType; out aLoc: TKMPoint): Boolean;
  
positive.code:   Result := False;
  
    case aHouse of
      ht_Store:           Result := NextToHouse([ht_Any], aHouse, aLoc);
      ht_ArmorSmithy:     Result := NextToHouse([ht_IronSmithy, ht_CoalMine, ht_Barracks], aHouse, aLoc);
      ht_ArmorWorkshop:   Result := NextToHouse([ht_Tannery, ht_Barracks], aHouse, aLoc);
      ht_Bakery:          Result := NextToHouse([ht_Mill], aHouse, aLoc);
      ht_Barracks:        Result := NextToHouse([ht_Any], aHouse, aLoc);
      ht_Butchers:        Result := NextToHouse([ht_Swine], aHouse, aLoc);
      ht_Inn:             Result := NextToHouse([ht_Store], aHouse, aLoc);
      ht_IronSmithy:      Result := NextToHouse([ht_IronMine, ht_CoalMine], aHouse, aLoc);
      ht_Metallurgists:   Result := NextToHouse([ht_GoldMine], aHouse, aLoc);
      ht_Mill:            Result := NextToHouse([ht_Farm], aHouse, aLoc);
      ht_Sawmill:         Result := NextToHouse([ht_Woodcutters], aHouse, aLoc);
      ht_School:          Result := NextToHouse([ht_Store, ht_Barracks], aHouse, aLoc);
      ht_Stables:         Result := NextToHouse([ht_Farm], aHouse, aLoc);
      ht_Swine:           Result := NextToHouse([ht_Farm], aHouse, aLoc);
      ht_Tannery:         Result := NextToHouse([ht_Swine], aHouse, aLoc);
      ht_WeaponSmithy:    Result := NextToHouse([ht_IronSmithy, ht_CoalMine, ht_Barracks], aHouse, aLoc);
      ht_WeaponWorkshop:  Result := NextToHouse([ht_Sawmill, ht_Barracks], aHouse, aLoc);
  
      ht_CoalMine:      Result := NextToOre(aHouse, rt_Coal, aLoc);
      ht_GoldMine:      Result := NextToOre(aHouse, rt_GoldOre, aLoc);
  
negative.code: end;
  
  
  function TKMCityPlanner.NextToHouse(aHouse: THouseType; aTarget, aAvoid: array of THouseType; out aLoc: TKMPoint): Boolean;
  const RAD = 15;
  var
    I, K: Integer;
  