View Single Post
  #2  
Old 08-08-2012, 10:00 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Here's a update to the Corpse::QueryLoot portion of this patch.

It's not a required fix, but it does differentiate the shown and hidden items on a player's corpse. This is a direct replacement and not a patch.


[PlayerCorpse.cpp::Corpse::QueryLoot]
Code:
void Corpse::QueryLoot(Client* to) {
	int x = 0;
	to->Message(0, "Coin: %ip %ig %is %ic", platinum, gold, silver, copper);

	ItemList::iterator cur,end;
	cur = itemlist.begin();
	end = itemlist.end();
	for(; cur != end; cur++) {
		ServerLootItem_Struct* sitem = *cur;

		if (IsPlayerCorpse()) {
			if (sitem->equipSlot >= 251 && sitem->equipSlot <= 340)
				sitem->lootslot = 0xFFFF;
			else
				x < 30 ? sitem->lootslot = x : sitem->lootslot = 0xFFFF; // this con value needs to reflect corpselootlimit in MakeLootRequestPackets
			const Item_Struct* item = database.GetItem(sitem->item_id);

			if (item)
				to->Message((sitem->lootslot == 0xFFFF), "  LootSlot: %i (EquipSlot: %i) Item: %s (%d) with %i %s", sitem->lootslot, sitem->equipSlot, item->Name, item->ID, sitem->charges, sitem->charges==1?"charge":"charges");
			else
				to->Message((sitem->lootslot == 0xFFFF), "  Error: 0x%04x", sitem->item_id);
			if (sitem->lootslot != 0xFFFF)
				x++;
		}
		else {
			sitem->lootslot=x;
			const Item_Struct* item = database.GetItem(sitem->item_id);
			
			if (item)
				to->Message(0, "  LootSlot: %i Item: %s (%d) with %i %s", sitem->lootslot, item->Name, item->ID, sitem->charges, sitem->charges==1?"charge":"charges");
			else
				to->Message(0, "  Error: 0x%04x", sitem->item_id);
			x++;
		}
	}
	to->Message(0, "%i items on %s.", x, this->GetName());
}
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote