anchor.diff:        HT := H.HouseType;
         CheckExistHouse := False;
         for K := 0 to fPlannedHouses[HT].Count - 1 do
  -        if KMSamePoint(fPlannedHouses[HT].Plans[K].Loc, gHands[fOwner].Houses[I].Entrance) then
  +        if KMSamePoint(fPlannedHouses[HT].Plans[K].Loc, H.Entrance) then
           begin
  +          if (fPlannedHouses[HT].Plans[K].House <> H) then
  +          begin
  +            // Make sure that reservation is no longer used
  +            gHands[fOwner].AI.CityManagement.Builder.UnlockHouseLoc(HT, H.Entrance);
  +            if (fPlannedHouses[HT].Plans[K].House <> nil) then
  +              gHands.CleanUpHousePointer(fPlannedHouses[HT].Plans[K].House);
  +            fPlannedHouses[HT].Plans[K].House := H.GetHousePointer;
  +          end;
             CheckExistHouse := True;
             break;
           end;
  -      if not CheckExistHouse then
  +      if not CheckExistHouse then // House was added by script / spectator in debug mode
         begin
           if (HT = ht_Woodcutters) then
  -          AddPlan(HT, gHands[fOwner].Houses[I].Entrance, TKMHouseWoodcutters(H).FlagPoint, TKMHouseWoodcutters(H).WoodcutterMode = wcm_Chop)
  +          AddPlan(HT, H.Entrance, TKMHouseWoodcutters(H).FlagPoint, TKMHouseWoodcutters(H).WoodcutterMode = wcm_Chop)
           else
  -          AddPlan(HT, gHands[fOwner].Houses[I].Entrance);
  -      end;
  -    end;
  +          AddPlan(HT, H.Entrance);
  +      end;
  +    end;
  +  end;
  +  // Check if are existing houses completed / destroyed
  +  for HT := Low(fPlannedHouses) to High(fPlannedHouses) do
  +  begin
  +    SumCalculated := fPlannedHouses[HT].Count;
  +    for I := 0 to fPlannedHouses[HT].Count - 1 do
  +      with fPlannedHouses[HT].Plans[I] do
  +      begin
  +        Placed := ((House <> nil) AND not House.IsDestroyed) OR gHands[fOwner].BuildList.HousePlanList.ExistPlan(Loc, HT);
  +        if Placed then // House was placed
  +        begin
  +          if (HT = ht_Woodcutters) AND (House <> nil) AND (House.IsComplete) then
  +            CheckWoodcutter(fPlannedHouses[HT].Plans[I], CheckChopOnly);
  +        end
  +        else if (HouseReservation OR RemoveTreeInPlanProcedure) then // House was reserved
  +        begin
  +          // Do nothing
  +        end
  +        else // House was destroyed
  +        begin
  +          SumCalculated := SumCalculated - 1;
  +        end;
  +      end;
  +    fPlannedHouses[HT].Calculated := SumCalculated;
     end;
   end;
   
  
positive.code: type
    THousePlan = record
      Placed, ShortcutsCompleted, RemoveTreeInPlanProcedure, HouseReservation, ChopOnly: Boolean;
      UID: Integer;
      Loc, SpecPoint: TKMPoint;
    end;
    THousePlanArray = record
      Count: Word;
      Plans: array of THousePlan;
    end;
    TPlannedHousesArray = array [HOUSE_MIN..HOUSE_MAX] of THousePlanArray;
  
negative.code:   begin
      if (aIdx >= Count) then
        Exit;
      if (Plans[aIdx].House = nil) then // Unlock house plan
        gHands[fOwner].AI.CityManagement.Builder.UnLockHouseLoc(aHT, Plans[aIdx].Loc);
      Count := Count - 1;
      Plans[aIdx] := Plans[Count];
  