anchor.diff:      begin
         //Order citizen training
         for UT := Low(UnitReq) to High(UnitReq) do
  -        if (UnitReq[UT] > 0) //Skip units that dont needed by houses (Serf/Worker)
  +        if (UnitReq[UT] > 0) //Skip units that houses dont need (Serfs/Workers)
           and (UnitReq[UT] > P.Stats.GetUnitQty(UT)) then
           begin
             Dec(UnitReq[UT]); //So other schools don't order same unit
  
positive.code: procedure TKMayor.CheckUnitCount;
  var
    P: TKMHand;
    HS: TKMHouseSchool;
    UnitReq: array [CITIZEN_MIN..CITIZEN_MAX] of Integer;
  
    function HasEnoughGold: Boolean;
    begin
      //Producing gold or (Gold > 10)
      Result := (P.Stats.GetWaresProduced(wt_Gold) > 1)
                or (P.Stats.GetWareBalance(wt_Gold) > 20);
    end;
  
    function TryAddToQueue(aUnitType: TUnitType; aReq: Integer): Boolean;
    begin
      //We summ up requirements for e.g. Recruits required at Towers and Barracks
      if P.Stats.GetUnitQty(aUnitType) < (aReq + UnitReq[aUnitType]) then
      begin
        Dec(UnitReq[aUnitType]); //So other schools don't order same unit
        HS.AddUnitToQueue(aUnitType, 1);
        Result := True;
      end
      else
  
negative.code:   H: THouseType;
    UT: TUnitType;
    Schools: array of TKMHouseSchool;
    HS: TKMHouseSchool;
    serfCount: Integer;
  begin
    //todo: When training new units make sure we have enough gold left to train
    //stonemason-woodcutter-carpenter-2miners-metallurgist. In other words -
  