PDA

View Full Version : Fix for Loot 'getting stuck' on LootErrorPackets


Dakaar
09-16-2005, 01:10 PM
Hey all. So After trying to loot multiple items off a pvp corpse, I got a "error: you cannot loot anymore items from this corpse" then the client would get bugged.

The client stays connected but cannot target or manipulate his UI such as inventory etc.

The problem is that the packet does not get queue'd because these error cases return before the packet is sent at the end of the function. Simply Queue the packet to the client before returning and your looting should be bug-free

ie: in playercorpse.cpp around line 836

if(IsPlayerCorpse() && (charid != client->CharacterID()) && CanMobLoot(client->CharacterID()) && GetPKItem()==0){
client->Message(13, "Error: You cannot loot any more items from this corpse.");
SendEndLootErrorPacket(client);
BeingLootedBy = 0xFFFFFFFF;
+ client->QueuePacket(app);
return;
}


Add the client->QueuePacket(app); before the return, and the client wont get stuck any longer.

A better way to do this would be to have SendEndLootErrorPacket take app as a argument and have it queue the packet somewhere in the function.