anchor.diff:    if (Node1Idx = -1) OR (Node2Idx = -1) then
       Exit;
   
  -  if fPlanner.GetHousePlan(aUnlockProcedure, aHT, Loc, HouseIdx) then
  +  if fPlanner.GetHousePlan(aUnlockProcedure, aIgnoreExistingPlans, aHT, Loc, HouseIdx) then
     begin
       // Check if we can place house by default KaM function
       if gHands[fOwner].CanAddHousePlan(Loc, aHT) then
  
positive.code: 
  
  procedure TKMCityBuilder.UpdateState(aTick: Cardinal; out aFreeWorkersCnt: Integer);
  var
    Outline1, Outline2: TKMWeightSegments;
  begin
    if (aTick mod MAX_HANDS = fOwner) then
    begin
      fPlanner.UpdateState(aTick); // Planner must be updated as first to secure that completed houses are actualized
      UpdateBuildNodes(aFreeWorkersCnt);
    end;
    ////((gGame.GameOptions.Peacetime <> 0) and gGame.CheckTime(600 * Max(0, gGame.GameOptions.Peacetime - 15)))
    //if (aTick = 50) then
    //  gAIFields.NavMesh.GetDefenceOutline(fOwner, Outline1, Outline2);
  end;
  
  
  
negative.code:   end
    else
    begin
      Output := cs_NoPlaceCanBeFound;
    end;
    Result := Output;
  end;
  
  
  procedure TKMCityBuilder.ChooseHousesToBuild(aFreeWorkersCnt: Integer; aTick: Cardinal);
  type
    TSetOfWare = set of TWareType;
    TSetOfHouseType = set of THouseType;
  const
  
    //ht_Woodcutters,    ht_Quary,         ht_Sawmill,        ht_IronMine,      ht_GoldMine,
    //ht_CoalMine,       ht_IronSmithy,    ht_Metallurgists,  ht_Wineyard,      ht_Farm,
    //ht_Bakery,         ht_Mill,          ht_Tannery,        ht_Butchers,      ht_Swine,
    //ht_Swine,          ht_ArmorWorkshop, ht_ArmorSmithy,    ht_ArmorWorkshop, ht_ArmorSmithy,
    //ht_WeaponWorkshop, ht_WeaponSmithy,  ht_WeaponWorkshop, ht_WeaponSmithy,  ht_WeaponWorkshop,
    //ht_WeaponSmithy,   ht_Stables,       ht_FisherHut
  
  
    BASIC_HOUSES: TSetOfHouseType = [ht_School, ht_Barracks, ht_Inn, ht_MarketPlace, ht_Store];
    BUILD_WARE: TSetOfWare = [wt_GoldOre, wt_Coal, wt_Gold, wt_Stone, wt_Trunk, wt_Wood];
    FOOD_WARE: TSetOfWare = [wt_Corn, wt_Flour, wt_Bread, wt_Pig, wt_Sausages, wt_Wine, wt_Fish];
    WEAPON_WARE: TSetOfWare = [wt_Skin, wt_Leather, wt_Horse, wt_IronOre, wt_Coal, wt_Steel, wt_Axe, wt_Bow, wt_Pike, wt_Armor, wt_Shield, wt_Sword, wt_Arbalet, wt_Hallebard, wt_MetalShield, wt_MetalArmor];
    BUILD_ORDER_WARE: array[0..5] of TWareType = (wt_Stone, wt_Gold, wt_GoldOre, wt_Coal, wt_Trunk, wt_Wood);
  var
    StoneShortage, WoodShortage, TrunkShortage, GoldShortage: Boolean;
    MaxPlans: Integer;
    RequiredHouses: TRequiredHousesArray;
    WareBalance: TWareBalanceArray;
  
  