anchor.diff:    begin
       fCornDelay := gGame.GameTickCount + 6000; // 10 ticks = 1 sec (farm requires 10 min to produce)
     end;
  -  if not GA_PLANNER AND (gGame.GameTickCount - fCornDelay < 0) then
  -  begin
  -    RequiredHouses[ht_Swine] := 0;
  +  if not GA_PLANNER then
  +  begin
  +    RequiredHouses[ht_Sawmill] := Min(RequiredHouses[ht_Sawmill], Byte(gHands[fOwner].Stats.GetWareBalance(wt_Trunk) > 5));
  +    if (gGame.GameTickCount - fCornDelay < 0) then
  +    begin
  +      RequiredHouses[ht_Swine] := 0;
  +      RequiredHouses[ht_Mill] := 0;
  +      RequiredHouses[ht_Bakery] := 0;
  +    end;
       RequiredHouses[ht_Butchers] := RequiredHouses[ht_Butchers] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Pig) > 0);
       RequiredHouses[ht_Tannery] := RequiredHouses[ht_Tannery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Leather) > 0);
       RequiredHouses[ht_ArmorWorkshop] := RequiredHouses[ht_ArmorWorkshop] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Skin) > 0);
   
  -    RequiredHouses[ht_Mill] := 0;
  -    RequiredHouses[ht_Bakery] := RequiredHouses[ht_Bakery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Flour) > 0);
  -  end;
  -
  -  if (gGame.GameTickCount < 36000) then
  -    RequiredHouses[ht_Wineyard] := 0;
  -
  -  //RequiredHouses[ht_Swine] := RequiredHouses[ht_Swine] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Corn) > 0);
  -  //RequiredHouses[ht_Butchers] := RequiredHouses[ht_Butchers] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Pig) > 0);
  -  //RequiredHouses[ht_Tannery] := RequiredHouses[ht_Tannery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Leather) > 0);
  -  //RequiredHouses[ht_ArmorWorkshop] := RequiredHouses[ht_ArmorWorkshop] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Skin) > 0);
  -  //
  -  //RequiredHouses[ht_Mill] := RequiredHouses[ht_Mill] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Corn) > 0);
  -  //RequiredHouses[ht_Bakery] := RequiredHouses[ht_Bakery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Flour) > 0);
  -
  -
  -  RequiredHouses[ht_IronSmithy] := RequiredHouses[ht_IronSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_IronOre) > 0);
  -  RequiredHouses[ht_WeaponSmithy] := RequiredHouses[ht_WeaponSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
  -  RequiredHouses[ht_ArmorSmithy] := RequiredHouses[ht_ArmorSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
  +    if (gGame.GameTickCount < 36000) then
  +      RequiredHouses[ht_Wineyard] := 0;
  +
  +    //if (gHands[fOwner].Stats.GetWareBalance(wt_Corn) = 0) then
  +    //begin
  +    //  RequiredHouses[ht_Mill] := 0;
  +    //  RequiredHouses[ht_Swine] := 0;
  +    //end;
  +    //RequiredHouses[ht_Butchers] := RequiredHouses[ht_Butchers] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Pig) > 0);
  +    //RequiredHouses[ht_Tannery] := RequiredHouses[ht_Tannery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Leather) > 0);
  +    //RequiredHouses[ht_ArmorWorkshop] := RequiredHouses[ht_ArmorWorkshop] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Skin) > 0);
  +    //RequiredHouses[ht_Bakery] := RequiredHouses[ht_Bakery] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Flour) > 0);
  +    //
  +    //
  +    //RequiredHouses[ht_IronSmithy] := RequiredHouses[ht_IronSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_IronOre) > 0);
  +    //RequiredHouses[ht_WeaponSmithy] := RequiredHouses[ht_WeaponSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
  +    //RequiredHouses[ht_ArmorSmithy] := RequiredHouses[ht_ArmorSmithy] * Byte(gHands[fOwner].Stats.GetWareBalance(wt_Steel) > 0);
  +  end;
     //}
   end;
   
  
positive.code: // Update food consumption
  procedure TKMCityPredictor.UpdateFoodConsumption(aInitialization: Boolean = False);
  const
    CITIZEN_FOOD_COEF = 0.05; //On average citizen needs to eat each 40min but takes 2 food to full status = 1/20 = 0.05
    SOLDIER_FOOD_COEF = 0.025; //On average soldier needs to eat each 40min and takes 1 food to full status = 1/40 = 0.025
  var
    Consumption: Single;
  begin
    // Get consumption of city + army
    Consumption := (fCityStats.CitizensCnt * CITIZEN_FOOD_COEF) + (fCityStats.WarriorsCnt * SOLDIER_FOOD_COEF);
    // Calculate consumption of leather armor / min and pigs which are produced with this cycle
    // 2x armor = 2x leather = 1x skin = 1x pig = 3x sausages ... sausages = 3 / 2 * armor = 1.5 * armor
    fWareBalance[wt_Sausages].ActualConsumption := Min(Consumption, fWareBalance[wt_Armor].FinalConsumption * 1.5);
  
negative.code: 
      constructor Create(aPlayer: TKMHandIndex);
      destructor Destroy(); override;
      procedure Save(SaveStream: TKMemoryStream);
      procedure Load(LoadStream: TKMemoryStream);
  
      property CityStats: TCityStats read fCityStats;
      property WareBalance: TWareBalanceArray read fWareBalance;
  
      procedure AfterMissionInit();
      procedure CityInitialization(aGoldMineCnt, aIronMineCnt, aFieldCnt, aBuildCnt: Integer);
      procedure UpdateState(aTick: Cardinal);
      procedure LogStatus(var aBalanceText: UnicodeString);
      procedure OwnerUpdate(aPlayer: TKMHandIndex);
  
  