anchor.diff:  end;
   
   
  +procedure TKMHouseMarket.MoveResIn2Out(aWare: TKMWareType; aCnt: Integer);
  +begin
  +  aCnt := Min(aCnt, fMarketResIn[aWare]);
  +
  +  if aCnt = 0 then Exit;
  +
  +  //No need to call SetRes functins here, since its just moving resource from In to Out
  +  Inc(fMarketResOut[aWare], aCnt);
  +  gHands[fOwner].Deliveries.Queue.AddOffer(Self, aWare, aCnt); //Add res as offer, since they are in 'out' queue
  +  Dec(fMarketResIn[aWare], aCnt);
  +end;
  +
  +
  +function TKMHouseMarket.MoveResOut2In(aWare: TKMWareType; aCnt: Integer): Integer;
  +begin
  +  Result := Min(aCnt, fMarketResOut[aWare]);
  +
  +  if Result = 0 then Exit;
  +
  +  //No need to call SetRes functins here, since its just moving resource from Out to In
  +  Dec(fMarketResOut[aWare], Result);
  +  gHands[fOwner].Deliveries.Queue.RemOffer(Self, aWare, Result); //Remove offer, we moved wares to In
  +  Inc(fMarketResIn[aWare], Result);
  +end;
  +
  +
   function TKMHouseMarket.TradeInProgress: Boolean;
   begin
     Result := fTradeAmount > 0;
  
positive.code:   AttemptExchange;
  
    //If player cancelled exchange then move all remainders of From resource to Offers list
    if (fTradeAmount = 0) and (fMarketResIn[fResFrom] > 0) then
    begin
      //No need to call SetRes functins here, since its just moving resource from In to Out
      Inc(fMarketResOut[fResFrom], fMarketResIn[fResFrom]);
      gHands[fOwner].Deliveries.Queue.AddOffer(Self, fResFrom, fMarketResIn[fResFrom]);
      fMarketResIn[fResFrom] := 0;
    end;
  
    //@Lewin: If player has cancelled the exchange and then started it again resources will not be
    //removed from offers list and perhaps serf will carry them off the marketplace
  
negative.code:   //Maximum number of Demands we can place at once (stops the delivery queue from becoming clogged with 1500 items)
    MAX_RES_ORDERED = 10;
  var
    ResRequired, OrdersAllowed, OrdersRemoved, OrderToDo, movedOut2In: Integer;
  begin
    if (fResFrom = wtNone) or (fResTo = wtNone) or (fResFrom = fResTo) then Exit;
  
  