[7728] Use correct loot_type values in data sent to client instead long time existed hacks. Code cleanups. Author: VladimirMangos

Thanks to Seizerkiller and TOM_RUS for help in reseach.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-27 21:29:01 -05:00
parent 031c1b484c
commit bd4c2bdb64
2 changed files with 49 additions and 74 deletions
+18 -45
View File
@@ -7215,12 +7215,6 @@ void Player::RemovedInsignia(Player* looterPlr)
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
}
/*Loot type MUST be
1-corpse, go
2-skinning
3-Fishing
*/
void Player::SendLootRelease( uint64 guid )
{
WorldPacket data( SMSG_LOOT_RELEASE_RESPONSE, (8+1) );
@@ -7289,50 +7283,28 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
return;
}
if(loot_type == LOOT_DISENCHANTING)
{
loot = &item->loot;
if (!item->m_lootGenerated)
{
item->m_lootGenerated = true;
loot->clear();
switch(loot_type)
{
case LOOT_DISENCHANTING:
loot->FillLoot(item->GetProto()->DisenchantID, LootTemplates_Disenchant, this,true);
}
}
else if(loot_type == LOOT_PROSPECTING)
{
loot = &item->loot;
if(!item->m_lootGenerated)
{
item->m_lootGenerated = true;
loot->clear();
break;
case LOOT_PROSPECTING:
loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true);
}
}
else if(loot_type == LOOT_MILLING)
{
loot = &item->loot;
if(!item->m_lootGenerated)
{
item->m_lootGenerated = true;
loot->clear();
break;
case LOOT_MILLING:
loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true);
}
}
else
{
loot = &item->loot;
if(!item->m_lootGenerated)
{
item->m_lootGenerated = true;
loot->clear();
break;
default:
loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true);
loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot);
break;
}
}
}
@@ -7484,12 +7456,13 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
SetLootGUID(guid);
// LOOT_PICKPOCKETING, LOOT_PROSPECTING, LOOT_DISENCHANTING, LOOT_INSIGNIA and LOOT_MILLING unsupported by client, sending LOOT_SKINNING instead
if(loot_type == LOOT_PICKPOCKETING || loot_type == LOOT_DISENCHANTING || loot_type == LOOT_PROSPECTING || loot_type == LOOT_INSIGNIA || loot_type == LOOT_MILLING)
loot_type = LOOT_SKINNING;
if(loot_type == LOOT_FISHINGHOLE)
loot_type = LOOT_FISHING;
// LOOT_INSIGNIA and LOOT_FISHINGHOLE unsupported by client
switch(loot_type)
{
case LOOT_INSIGNIA: loot_type = LOOT_SKINNING; break;
case LOOT_FISHINGHOLE: loot_type = LOOT_FISHING; break;
default: break;
}
WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size
+9 -7
View File
@@ -458,14 +458,16 @@ enum ActivateTaxiReplies
enum LootType
{
LOOT_CORPSE = 1,
LOOT_SKINNING = 2,
LOOT_PICKPOCKETING = 2,
LOOT_FISHING = 3,
LOOT_PICKPOCKETING = 4, // unsupported by client, sending LOOT_SKINNING instead
LOOT_DISENCHANTING = 5, // unsupported by client, sending LOOT_SKINNING instead
LOOT_PROSPECTING = 6, // unsupported by client, sending LOOT_SKINNING instead
LOOT_INSIGNIA = 7, // unsupported by client, sending LOOT_SKINNING instead
LOOT_FISHINGHOLE = 8, // unsupported by client, sending LOOT_FISHING instead
LOOT_MILLING = 9 // unsupported by client, sending LOOT_SKINNING instead
LOOT_DISENCHANTING = 4,
// ignored always by client
LOOT_SKINNING = 6,
LOOT_PROSPECTING = 7,
LOOT_MILLING = 8,
LOOT_FISHINGHOLE = 20, // unsupported by client, sending LOOT_FISHING instead
LOOT_INSIGNIA = 21 // unsupported by client, sending LOOT_CORPSE instead
};
enum MirrorTimerType