Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-22-2003, 08:48 PM
kaldec
Fire Beetle
 
Join Date: May 2003
Posts: 11
Default NPC Trading

I've been trying to work out some kinks I've had with NPC trading. The first problem I had was getting a bunch of "GetItemAt(X)" messages spamming my chat window. I looked through the code and found this in client.cpp:

Code:
bool Client::MoveItem(int16 to_slot, int16 from_slot, uint8 quantity){
    	if ( to_slot >=3000 && to_slot <= 3016){// Item Trade

			TradeList[to_slot-3000] = GetItemAt(0);

			TradeCharges[to_slot-3000] = pp.invitemproperties[0].charges;

////////////////////////////////////////////////////////////////
			for (int j = 0;j != 10;j++) {

				TradeList[((to_slot-2999)*10)+j] = GetItemAt(80+j);

				TradeCharges[((to_slot-2999)*10)+j] = GetItemPropAt(80+j).charges;

			}
////////////////////////////////////////////////////////////////
I can't make sense of the portion of the code between the comments, it is what generates the spam. The GetItemAt call must fail as 80-89 are invalid item slots for a player profile, and all of these calls will spit out the error and return 0. It seems that either this chunk should be removed, or the values set to 0 directly, or the error message removed from Client::GetItemAt.

I've noticed that at least one server doesn't have this problem, so I'm not sure if something is dorked in my setup or if that admin has altered the code.

I'm also seeing a problem with items traded to NPCs remaining tied to the cursor so that they reapear if I camp and come back. While this is great for quests, it's not ideal. Hopefully I can figure this out by comparing the code for selling which seems to remove the item okay.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:47 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3