Core/Entities: Use ObjectGuid class in game project

This commit is contained in:
Shauren
2014-09-14 16:14:12 +02:00
parent ce67a097bf
commit a0e50ea35f
256 changed files with 3334 additions and 3833 deletions

View File

@@ -69,7 +69,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
uint8 bagIndex, slot, castFlags;
uint8 castCount; // next cast if exists (single or not)
uint64 itemGUID;
ObjectGuid itemGUID;
uint32 glyphIndex; // something to do with glyphs?
uint32 spellId; // cast spell id
@@ -242,7 +242,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
uint32 entry = fields[0].GetUInt32();
uint32 flags = fields[1].GetUInt32();
item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, 0);
item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, ObjectGuid::Empty);
item->SetEntry(entry);
item->SetUInt32Value(ITEM_FIELD_FLAGS, flags);
item->SetState(ITEM_CHANGED, pUser);
@@ -266,10 +266,10 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
{
uint64 guid;
ObjectGuid guid;
recvData >> guid;
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [%s]", guid.ToString().c_str());
if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid))
{
@@ -287,10 +287,10 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
{
uint64 guid;
ObjectGuid guid;
recvPacket >> guid;
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid));
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [%s]", guid.ToString().c_str());
// ignore for remote control state
if (_player->m_mover != _player)
@@ -391,7 +391,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
spellInfo = actualSpellInfo;
}
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE, 0, false);
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE, ObjectGuid::Empty, false);
spell->m_cast_count = castCount; // set count of casts
spell->prepare(&targets);
}
@@ -436,7 +436,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
return;
// maybe should only remove one buff when there are multiple?
_player->RemoveOwnedAura(spellId, 0, 0, AURA_REMOVE_BY_CANCEL);
_player->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
// If spell being removed is a resource tracker, see if player was tracking both (herbs / minerals) and remove the other
if (sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES) && spellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES))
@@ -453,14 +453,14 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
// Remove all auras related to resource tracking (only Herbs and Minerals in 3.3.5a)
for (std::list<uint32>::iterator it = spellIDs.begin(); it != spellIDs.end(); it++)
_player->RemoveOwnedAura(*it, 0, 0, AURA_REMOVE_BY_CANCEL);
_player->RemoveOwnedAura(*it, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
}
}
}
void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
{
uint64 guid;
ObjectGuid guid;
uint32 spellId;
recvPacket >> guid;
@@ -477,13 +477,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
if (!pet)
{
TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %u by player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str());
TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant %s by player '%s'", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
{
TC_LOG_ERROR("network", "HandlePetCancelAura: Pet %u is not a pet of player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str());
TC_LOG_ERROR("network", "HandlePetCancelAura: %s is not a pet of player '%s'", guid.ToString().c_str(), GetPlayer()->GetName().c_str());
return;
}
@@ -493,7 +493,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
return;
}
pet->RemoveOwnedAura(spellId, 0, 0, AURA_REMOVE_BY_CANCEL);
pet->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
pet->AddCreatureSpellCooldown(spellId);
}
@@ -561,7 +561,7 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/)
void WorldSession::HandleSpellClick(WorldPacket& recvData)
{
uint64 guid;
ObjectGuid guid;
recvData >> guid;
// this will get something not in world. crash
@@ -580,7 +580,7 @@ void WorldSession::HandleSpellClick(WorldPacket& recvData)
void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
{
TC_LOG_DEBUG("network", "WORLD: CMSG_GET_MIRRORIMAGE_DATA");
uint64 guid;
ObjectGuid guid;
recvData >> guid;
// Get unit for which data is needed by client
@@ -668,7 +668,7 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
{
TC_LOG_DEBUG("network", "WORLD: CMSG_UPDATE_PROJECTILE_POSITION");
uint64 casterGuid;
ObjectGuid casterGuid;
uint32 spellId;
uint8 castCount;
float x, y, z; // Position of missile hit