anchor.diff:               HousesNearBy := true;
   
        if (TileIsRoadable(Loc))and
  -        ((Land[Loc.Y,Loc.X].Obj=255) or (MapElem[Land[Loc.Y,Loc.X].Obj+1].CanBeRemoved = 1))and
  -        //Only certain objects are excluded
  +        ((Land[Loc.Y,Loc.X].Obj=255) or (MapElem[Land[Loc.Y,Loc.X].Obj+1].CanBeRemoved = 1))and //Only certain objects are excluded
           (Land[Loc.Y,Loc.X].Markup=mu_None)and
  -        (not (Land[Loc.Y,Loc.X].Terrain in [55,59..63]))and //Can't build houses on fields
  +        (not TileIsCornField(Loc))and
  +        (not TileIsWineField(Loc))and //Can't build houses on fields
           (TileInMapCoords(Loc.X,Loc.Y,1))and
  -        //No houses nearby
  -        (not HousesNearBy) then
  +        (not HousesNearBy) then //No houses nearby
           AddPassability(Loc, [canBuild]);
   
        if (Land[Loc.Y,Loc.X].Terrain in [109,166..170])and
  -        (Land[Loc.Y,Loc.X].Rotation = 0)and     
  +        (Land[Loc.Y,Loc.X].Rotation = 0)and //only horizontal mountain edges allowed
           ((Land[Loc.Y,Loc.X].Obj=255) or (MapElem[Land[Loc.Y,Loc.X].Obj+1].CanBeRemoved = 1))and
           (Land[Loc.Y,Loc.X].Markup=mu_None)and
  -        (not (Land[Loc.Y,Loc.X].Terrain in [55,59..63]))and //Can't build houses on fields
  +        (not TileIsCornField(Loc))and
  +        (not TileIsWineField(Loc))and //Can't build houses on fields
           (TileInMapCoords(Loc.X,Loc.Y,1))and
  -        //No houses nearby
  -        (not HousesNearBy) then
  +        (not HousesNearBy) then //No houses nearby
          AddPassability(Loc, [canBuildIron]);
   
        if (Land[Loc.Y,Loc.X].Terrain in [171..175])and
           (Land[Loc.Y,Loc.X].Rotation = 0)and
           ((Land[Loc.Y,Loc.X].Obj=255) or (MapElem[Land[Loc.Y,Loc.X].Obj+1].CanBeRemoved = 1))and
           (Land[Loc.Y,Loc.X].Markup=mu_None)and
  -        (not (Land[Loc.Y,Loc.X].Terrain in [55,59..63]))and //Can't build houses on fields
  +        (not TileIsCornField(Loc))and
  +        (not TileIsWineField(Loc))and //Can't build houses on fields
           (TileInMapCoords(Loc.X,Loc.Y,1))and
  -        //No houses nearby
  -        (not HousesNearBy) then
  +        (not HousesNearBy) then //No houses nearby
          AddPassability(Loc, [canBuildGold]);
   
        if (TileIsRoadable(Loc))and
  
positive.code:   function TileInMapCoords(X,Y:integer; Inset:byte=0):boolean;
    function SetTileInMapCoords(X,Y:integer; Inset:byte=0):TKMPoint;
    function VerticeInMapCoords(X,Y:integer; Inset:byte=0):boolean;
    function TileIsWater(Loc:TKMPoint):boolean;
    function TileIsSand(Loc:TKMPoint):boolean;
    function TileIsStone(Loc:TKMPoint):byte;
  
negative.code:   for h:=1 to 8 do
      if Land[i,k].FogOfWar[h] > TERRAIN_FOG_OF_WAR_MIN then dec(Land[i,k].FogOfWar[h]);
  
      if InRange(Land[i,k].FieldAge,1,65534) then
      begin       
        inc(Land[i,k].FieldAge);
        if TileIsCornField(KMPoint(k,i)) then
          case Land[i,k].FieldAge of
             45: SetLand(k,i,61,255);  //Numbers are measured from KaM, ~195sec
            240: SetLand(k,i,59,255);
            435: SetLand(k,i,60,58);
            630: SetLand(k,i,60,59);
            650: Land[i,k].FieldAge:=65535; //Skip to the end
          end
        else
        if TileIsWineField(KMPoint(k,i)) then
          case Land[i,k].FieldAge of
            45: SetLand(k,i,55,54);
           240: SetLand(k,i,55,55);
           435: SetLand(k,i,55,56);
           630: SetLand(k,i,55,57);
           650: Land[i,k].FieldAge:=65535; //Skip to the end
          end;
      end;
  
      if InRange(Land[i,k].TreeAge,1,65534) then
      begin
        inc(Land[i,k].TreeAge);
        if (Land[i,k].TreeAge=45)or(Land[i,k].TreeAge=240)or(Land[i,k].TreeAge=435)or(Land[i,k].TreeAge=630) then //Speedup
        for h:=1 to length(ChopableTrees) do
          for j:=1 to 3 do
            if Land[i,k].Obj=ChopableTrees[h,j] then
              case Land[i,k].TreeAge of
                45: Land[i,k].Obj:=ChopableTrees[h,2];
               240: Land[i,k].Obj:=ChopableTrees[h,3];
               435: Land[i,k].Obj:=ChopableTrees[h,4];
               630: Land[i,k].TreeAge:=65535; //Skip to the end
              end;
      end;
  
    end;
  end;
  