anchor.diff:  var
     I: Integer;
     Loc: TKMPoint;
  +  H: TKMHouse;
   begin
     //Wait until resource is depleted and output is empty
     for I := 0 to gHands[fOwner].Houses.Count - 1 do
  -  if not gHands[fOwner].Houses[I].IsDestroyed
  -    AND gHands[fOwner].Houses[I].ResourceDepletedMsgIssued
  -    AND (gHands[fOwner].Houses[I].CheckResOut(wt_All) = 0) then
  -  begin
  -    Loc := gHands[fOwner].Houses[I].Entrance;
  -    // Remove avoid building around coal mine
  -    if (gHands[fOwner].Houses[I].HouseType = htCoalMine) then
  -      gAIFields.Influences.RemAvoidBuilding(KMRect(Loc.X-3, Loc.Y-3, Loc.X+4, Loc.Y+2));
  -    // Mark house plan as exhausted
  -    Builder.Planner.MarkAsExhausted(gHands[fOwner].Houses[I].HouseType, Loc);
  -    gHands[fOwner].Houses[I].DemolishHouse(fOwner);
  +  begin
  +    H := gHands[fOwner].Houses[I];
  +    if not H.IsDestroyed
  +      AND H.ResourceDepletedMsgIssued
  +      AND (H.CheckResOut(wt_All) = 0) then
  +    begin
  +      Loc := H.Entrance;
  +      // Remove avoid building around coal mine
  +      if (H.HouseType = htCoalMine) then
  +        gAIFields.Influences.RemAvoidBuilding(KMRect(Loc.X-3, Loc.Y-3, Loc.X+4, Loc.Y+2));
  +      // Mark house plan as exhausted
  +      Builder.Planner.MarkAsExhausted(H.HouseType, Loc);
  +      H.DemolishHouse(fOwner);
  +    end;
     end;
   end;
   
  
positive.code:     UnitReq[ut_Worker] := 0;
      if (Stats.GetWareBalance(wt_Gold) > LACK_OF_GOLD * 2.5) OR (GoldProduced > 0) then // Dont train servs / workers / recruits when we will be out of gold
      begin
        UnitReq[ut_Worker] :=  fSetup.WorkerCount;
        UnitReq[ut_Recruit] := RecruitsNeeded(Houses[htWatchTower]);
      end;
      if (Stats.GetWareBalance(wt_Gold) > LACK_OF_GOLD * 1.5) OR (GoldProduced > 0) then // Dont train servs / workers / recruits when we will be out of gold
  
negative.code:   if GoldShortage then
    begin
      UnitReq[ut_Serf] := 3; // 3x Serf
      UnitReq[ut_Worker] := Byte(fPredictor.WorkerCount > 0);// 1x Worker
      UnitReq[ut_Miner] := Stats.GetHouseTotal(htCoalMine) + Stats.GetHouseTotal(htGoldMine) + Stats.GetHouseQty(htIronMine); // Miner can go into iron / gold / coal mines (idealy we need 1 gold and 1 coal but it is hard to catch it)
      UnitReq[ut_Metallurgist] := Stats.GetHouseTotal(htMetallurgists) + Stats.GetHouseQty(htIronSmithy); // Metallurgist (same problem like in case of miner)
      UnitReq[ut_Woodcutter] := Byte(Stats.GetHouseQty(htWoodcutters) > 0); // 1x Woodcutter
  