anchor.diff:  end;
   
   
  -procedure TKMayorBalance.CoalDistribution;
  +procedure TKMayorBalance.DistributeCoal;
   var
     CoalProductionRate, CoalConsumptionRate: Single;
   begin
  
positive.code: procedure TKMayorBalance.AppendWeaponry;
  var
    I, Best: TResourceType;
    BestBid: Single;
  begin
    Best := rt_None;
  
    BestBid := MaxSingle;
    for I := WARFARE_MIN to WARFARE_MAX do
    if (((ArmyType = atLeather) and (I in [rt_Shield, rt_Armor, rt_Axe, rt_Pike, rt_Bow, rt_Horse]))
        or ((ArmyType = atIron) and (I in [rt_MetalShield, rt_MetalArmor, rt_Sword, rt_Hallebard, rt_Arbalet, rt_Horse])))
    and (fDemandWeaponry.Weaponry[I].Balance < BestBid) then
    begin
      Best := I;
      BestBid := fDemandWeaponry.Weaponry[I].Balance;
    end;
  
    //Don't need anything
  
negative.code: end;
  
  
  procedure TKMayorBalance.DistributeCorn;
  var
    CornProductionRate, CornConsumptionRate: Single;
  begin
    CornProductionRate := HouseCount(ht_Farm) * ProductionRate[rt_Corn];
  
    //With stable production rate we can assume consumption rate that would be required
    CornConsumptionRate := HouseCount(ht_Mill) * ProductionRate[rt_Flour]
                         + HouseCount(ht_Swine) * ProductionRate[rt_Pig] * 4
                         + HouseCount(ht_Stables) * ProductionRate[rt_Horse] * 4;
  
    if CornProductionRate >= CornConsumptionRate then
    begin
      //Let every industry think the extra belongs to it
      fDemandFood.Bread.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Mill) * ProductionRate[rt_Flour]) * 2;
      fDemandFood.Sausages.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Swine) * ProductionRate[rt_Pig] * 4) / 4 * 3;
      fDemandWeaponry.WoodenArmor.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Swine) * ProductionRate[rt_Skin] * 4) / 4 * 2;
      fDemandWeaponry.Horse.FarmTheory := (CornProductionRate - CornConsumptionRate + HouseCount(ht_Stables) * ProductionRate[rt_Horse] * 4) / 4;
    end
    else
    begin
      //Share proportionaly
      fDemandFood.Bread.FarmTheory := CornProductionRate / CornConsumptionRate * (HouseCount(ht_Mill) * ProductionRate[rt_Flour]) * 2;
      fDemandFood.Sausages.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Swine) * ProductionRate[rt_Pig]) / 4 * 3;
      fDemandWeaponry.WoodenArmor.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Swine) * ProductionRate[rt_Skin] * 4) / 4 * 2;
      fDemandWeaponry.Horse.FarmTheory := (CornProductionRate / CornConsumptionRate * HouseCount(ht_Stables) * ProductionRate[rt_Horse]) / 4;
    end;
  end;
  
  
  procedure TKMayorBalance.UpdateBalanceFood;
  var
    P: TKMPlayer;
  begin
    P := fPlayers[fOwner];
  
    with fDemandFood do
    begin
  