anchor.diff:    for I := Max(TreeLoc.Y - HUT_RAD, 1) to Min(TreeLoc.Y + HUT_RAD, fTerrain.MapY - 1) do
     for K := Max(TreeLoc.X - HUT_RAD, 1) to Min(TreeLoc.X + HUT_RAD, fTerrain.MapX - 1) do
       if (fAIFields.Influences.AvoidBuilding[I,K] = 0)
  -    and (fAIFields.Influences.GetBestOwner(K, I) = fOwner)
       and fPlayers[fOwner].CanAddHousePlanAI(K, I, aHouse, False) then
       begin
         Bid := KMLength(KMPoint(K,I), TargetLoc) + KaMRandom * 5;
  -      if Bid < BestBid then
  +      TerOwner := fAIFields.Influences.GetBestOwner(K,I);
  +      if (Bid < BestBid) and ((TerOwner = fOwner) or (TerOwner = PLAYER_NONE)) then
         begin
           aLoc := KMPoint(K,I);
           BestBid := Bid;
  
positive.code: 
      function NextToOre(aHouse: THouseType; aOreType: TResourceType; out aLoc: TKMPoint): Boolean;
      function NextToHouse(aTarget: array of THouseType; aHouse: THouseType; out aLoc: TKMPoint): Boolean;
      function NextToStone(aHouse: THouseType; 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;
    public
  
negative.code:     ht_GoldMine:      Result := NextToOre(aHouse, rt_GoldOre, aLoc);
      ht_IronMine:      Result := NextToOre(aHouse, rt_IronOre, aLoc);
  
      ht_Quary:         Result := FindPlaceForQuary(aLoc);
      ht_Woodcutters:   Result := NextToTrees([ht_Store, ht_Woodcutters], aHouse, aLoc);
      ht_Farm:          Result := NextToGrass(ht_Any, aHouse, aLoc);
      ht_Wineyard:      Result := NextToGrass(ht_Any, aHouse, aLoc);
  