anchor.diff:    WalkConnectID := Land[OriginLoc.Y,OriginLoc.X].WalkConnect[wcType]; //Store WalkConnect ID of origin
   
     //If target is accessable then use it
  -  if fTerrain.CheckPassability(TargetLoc, aPass) and (WalkConnectID = Land[TargetLoc.Y,TargetLoc.X].WalkConnect[wcType]) then
  +  if CheckPassability(TargetLoc, aPass) and (WalkConnectID = Land[TargetLoc.Y,TargetLoc.X].WalkConnect[wcType]) then
     begin
       Result := TargetLoc;
       exit;
  
positive.code:   begin
      if (Land[y,x].WalkConnect[wcType]=0)and(Pass in Land[y,x].Passability)and //Untested area
       ((wcType <> wcAvoid)or
       ( (wcType=wcAvoid) and not fTerrain.TileIsLocked(KMPoint(x,y)) )) then //Matches passability
      begin
        Land[y,x].WalkConnect[wcType]:=ID;
        inc(Count);
  
negative.code: 
  
  procedure TTerrain.GetHouseMarks(aPosition:TKMPoint; aHouseType:THouseType; aList:TKMPointTagList);
  var
    i,k,s,t:integer;
    P2:TKMPoint;
    AllowBuild:boolean;
    HA: THouseArea;
  
    procedure MarkPoint(aPoint:TKMPoint; aID:integer);
    var v: integer;
    begin
      for v:=1 to aList.Count do //Skip wires from comparison
        if (aList.Tag[v] <> 0) and KMSamePoint(aList.List[v],aPoint) then
          Exit;
      aList.AddEntry(aPoint, aID, 0);
    end;
  begin
    HA := fResource.HouseDat[aHouseType].BuildArea;
  
    for i:=1 to 4 do for k:=1 to 4 do
    if HA[i,k]<>0 then
    begin
  
      if TileInMapCoords(aPosition.X+k-3-fResource.HouseDat[aHouseType].EntranceOffsetX,aPosition.Y+i-4,1) then
      begin
        //This can't be done earlier since values can be off-map
        P2 := KMPoint(aPosition.X+k-3-fResource.HouseDat[aHouseType].EntranceOffsetX,aPosition.Y+i-4);
  
        //Check house-specific conditions, e.g. allow shipyards only near water and etc..
        case aHouseType of
          ht_IronMine: AllowBuild := (CanBuildIron in Land[P2.Y,P2.X].Passability);
          ht_GoldMine: AllowBuild := (CanBuildGold in Land[P2.Y,P2.X].Passability);
          else         AllowBuild := (CanBuild     in Land[P2.Y,P2.X].Passability);
        end;
  
        //Forbid planning on unrevealed areas
        AllowBuild := AllowBuild and (MyPlayer.FogOfWar.CheckTileRevelation(P2.X,P2.Y) > 0);
  
        //Check surrounding tiles in +/- 1 range for other houses pressence
        if not (CanBuild in Land[P2.Y,P2.X].Passability) then
        for s:=-1 to 1 do for t:=-1 to 1 do
        if (s<>0)or(t<>0) then  //This is a surrounding tile, not the actual tile
        if Land[P2.Y+t,P2.X+s].Markup in [mu_HousePlan, mu_HouseFenceCanWalk, mu_HouseFenceNoWalk, mu_House] then
        begin
          MarkPoint(KMPoint(P2.X+s,P2.Y+t),479);
          AllowBuild := false;
  