anchor.diff:    WT: TWareType;
     GT: TGroupType;
     UT: TUnitType;
  -  Warfare: TWarfareArr;
  +  Warfare: TKMWarfareArr;
   begin
     ArmorCnt := gHands[fOwner].Stats.GetHouseQty(ht_ArmorSmithy) + gHands[fOwner].Stats.GetHouseQty(ht_ArmorWorkshop);
     SmithyCnt := gHands[fOwner].Stats.GetHouseQty(ht_WeaponSmithy);
  
positive.code:   SELL_LIMIT = 100;
  begin
  
  
    MarketCnt := gHands[fOwner].Stats.GetHouseQty(ht_Marketplace);
    if MarketCnt = 0 then
      Exit;
  
    //TryBuyItem(wt_Coal, wt_GoldOre);
    //{
    RequiedCnt := 0;
    SetLength(RequiredWares,3);
  
    // Gold
    if (gHands[fOwner].Stats.GetHouseQty(ht_Metallurgists) = 0)
       AND (gHands[fOwner].Stats.GetWareBalance(wt_Gold) <= LACK_OF_GOLD) then
       AddWare(wt_Gold);
    // Gold ore
    if ( gHands[fOwner].Stats.GetHouseQty(ht_GoldMine) < gHands[fOwner].Stats.GetHouseQty(ht_Metallurgists) )
      AND ( gHands[fOwner].Stats.GetWareBalance(wt_Gold) < MIN_GOLD_AMOUNT )
      AND ( gHands[fOwner].Stats.GetWareBalance(wt_GoldOre) < MIN_GOLD_AMOUNT ) then
      AddWare(wt_GoldOre);
    // Coal
    if ( gHands[fOwner].Stats.GetHouseQty(ht_CoalMine) < (gHands[fOwner].Stats.GetHouseQty(ht_Metallurgists) + gHands[fOwner].Stats.GetHouseQty(ht_IronSmithy) + gHands[fOwner].Stats.GetHouseQty(ht_WeaponSmithy) + gHands[fOwner].Stats.GetHouseQty(ht_ArmorSmithy)) )
      AND ( gHands[fOwner].Stats.GetWareBalance(wt_Coal) < MIN_GOLD_AMOUNT ) then
      AddWare(wt_Coal);
    // Stone
    if (gHands[fOwner].Stats.GetWareBalance(wt_Gold) < LACK_OF_STONE)
      AND (gHands[fOwner].Stats.GetHouseQty(ht_Quary) = 0) then
      AddWare(wt_Stone);
  
    if RequiedCnt = 0 then
      Exit;
  
negative.code:   end;
  
    // Get count of needed weapons
    for UT := ut_AxeFighter to WARRIOR_EQUIPABLE_MAX do // Skip militia
      for I := Low(TroopCost[UT]) to High(TroopCost[UT]) do
        if (TroopCost[UT,I] <> wt_None) then
        begin
          WT := TroopCost[UT,I];
          Warfare[WT].Required := Warfare[WT].Required + fWarriorsDemands[UT];
        end
        else
          break;
  