anchor.diff:  
   
   // Calculate weapons demand from combat AI requirements
  -function TKMCityManagement.WeaponsBalance(): TKMWarfareArr;
  +procedure TKMCityManagement.WeaponsBalance();
   var
     EnemyEval, AllyEval: TKMArmyEval;
   
  
positive.code: 
  type
    TKMWarfareArr = array[WARFARE_MIN..WARFARE_MAX] of record
      Avaiable, Required: Word;
      Fraction: Single;
    end;
    TKMWarriorsDemands = array[WARRIOR_EQUIPABLE_MIN..WARRIOR_EQUIPABLE_MAX] of Integer;
  
negative.code:       if (TroopCost[UT,I] <> wt_None) then
        begin
          WT := TroopCost[UT,I];
          fRequiredWeapons[WT].Required := fRequiredWeapons[WT].Required + fWarriorsDemands[UT];
        end
        else
          break;
  
    // Make sure that we always produce something
    CheckMinArmyReq();
  
    // Calculate fraction of demands
    for WT := Low(fRequiredWeapons) to High(fRequiredWeapons) do
      with fRequiredWeapons[WT] do
        Fraction := Available / Max(1,Required);
  
    // Calculate mean fraction of iron weapons and distribute steal
    WeaponFraction := 0;
    ArmorFraction := 0;
    for WT in IRON_WEAPONS do
      WeaponFraction := WeaponFraction + fRequiredWeapons[WT].Fraction;
    for WT in IRON_ARMORS do
      ArmorFraction := ArmorFraction + fRequiredWeapons[WT].Fraction;
    WeaponFraction := WeaponFraction / 3.0;
    ArmorFraction := ArmorFraction / 2.0;
    // Ware distribution = fraction / sum of fractions * 5
    gHands[fOwner].Stats.WareDistribution[wt_Steel, htWeaponSmithy] := Max(  1, Min(5, Round( ArmorFraction / (WeaponFraction + ArmorFraction) * 5) )  );
    gHands[fOwner].Stats.WareDistribution[wt_Steel, htArmorSmithy] := Max(  1, Min(5, Round( WeaponFraction / (WeaponFraction + ArmorFraction) * 5) )  );
  end;
  
  
  // Distribute required weapons into exist houses (first will be produced the larger amount of wares)
  procedure TKMCityManagement.OrderWeapons();
  const
    WEAPONS_PER_A_UPDATE = 3;
    PRODUCTION_HOUSES = [htArmorSmithy, htArmorWorkshop, htWeaponSmithy, htWeaponWorkshop];
  