anchor.diff:      //When trading target ware is priced higher
       CostFrom := fResource.Resources[fResFrom].MarketPrice;
       CostTo := fResource.Resources[fResTo].MarketPrice * MARKET_TRADEOFF_FACTOR;
  -    Result := Round(CostFrom/Min(CostFrom, CostTo));
  +    Result := Round(CostFrom / Min(CostFrom, CostTo));
     end else
       Result := 1;
   end;
   
   
  -procedure TKMHouseMarket.ResAddToIn(aResource: TResourceType; aCount:word=1; aFromScript:boolean=false);
  -var ResRequired:integer;
  +procedure TKMHouseMarket.ResAddToIn(aResource: TResourceType; aCount: Word = 1; aFromScript: Boolean = False);
  +var ResRequired: Integer;
   begin
     //If user cancelled the exchange (or began new one with different resources already)
     //then incoming resourced should be added to Offer list immediately
  
positive.code: var
    R: TResourceType;
  begin
    for R := WARE_MIN to WARE_MAX do
      fPlayers[fOwner].Stats.GoodConsumed(R, fMarketResIn[R] + fMarketResOut[R]);
  
  
negative.code:     //How much can we trade
      TradeCount := Min((fMarketResIn[fResFrom] div RatioFrom), fTradeAmount);
  
      Dec(fMarketResIn[fResFrom], TradeCount * RatioFrom);
      fPlayers[fOwner].Stats.GoodConsumed(fResFrom, TradeCount * RatioFrom);
      Dec(fTradeAmount, TradeCount);
      Inc(fMarketResOut[fResTo], TradeCount * RatioTo);
      fPlayers[fOwner].Stats.GoodProduced(fResTo, TradeCount * RatioTo);
      fPlayers[fOwner].Deliveries.Queue.AddOffer(Self, fResTo, TradeCount * RatioTo);
  
      fSoundLib.Play(sfxn_Trade, fPosition);
    end;
  end;
  
  
  procedure TKMHouseMarket.ResTakeFromOut(aResource: TResourceType; const aCount: Word = 1);
  begin
    Assert(aCount <= fMarketResOut[aResource]);
  
  