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.