This commit is contained in:
VladimirMangos 2010-03-13 16:12:13 +03:00
parent 8416702d7c
commit 2bf75e7a10
6 changed files with 26 additions and 24 deletions

View file

@ -466,7 +466,8 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
{
uint8 slotid;
uint64 lootguid, target_playerguid;
ObjectGuid lootguid;
ObjectGuid target_playerguid;
recv_data >> lootguid >> slotid >> target_playerguid;
@ -476,18 +477,18 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
return;
}
Player *target = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, target_playerguid));
Player *target = ObjectAccessor::FindPlayer(target_playerguid);
if(!target)
return;
sLog.outDebug("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName());
sLog.outDebug("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = %s [%s].", target_playerguid.GetString().c_str(), target->GetName());
if(_player->GetLootGUID() != lootguid)
if(_player->GetLootGUID() != lootguid.GetRawValue())
return;
Loot *pLoot = NULL;
if(IS_CREATURE_GUID(GetPlayer()->GetLootGUID()))
if(lootguid.IsCreature())
{
Creature *pCreature = GetPlayer()->GetMap()->GetCreature(lootguid);
if(!pCreature)
@ -495,7 +496,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
pLoot = &pCreature->loot;
}
else if(IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
else if(lootguid.IsGameobject())
{
GameObject *pGO = GetPlayer()->GetMap()->GetGameObject(lootguid);
if(!pGO)
@ -503,8 +504,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
pLoot = &pGO->loot;
}
if(!pLoot)
else
return;
if (slotid > pLoot->items.size())