Core/Entities: Use ObjectGuid class in game project
This commit is contained in:
1 parent
ce67a097bf
commit
a0e50ea35f
256 files changed
+3334
-3833
No files matched your search
@@ -379,7 +379,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
return;
|
||||
|
||||
// not save not player pets
|
||||
if (!IS_PLAYER_GUID(GetOwnerGUID()))
|
||||
if (!GetOwnerGUID().IsPlayer())
|
||||
return;
|
||||
|
||||
Player* owner = GetOwner();
|
||||
@@ -414,7 +414,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
// current/stable/not_in_slot
|
||||
if (mode >= PET_SAVE_AS_CURRENT)
|
||||
{
|
||||
uint32 ownerLowGUID = GUID_LOPART(GetOwnerGUID());
|
||||
uint32 ownerLowGUID = GetOwnerGUID().GetCounter();
|
||||
std::string name = m_name;
|
||||
CharacterDatabase.EscapeString(name);
|
||||
trans = CharacterDatabase.BeginTransaction();
|
||||
@@ -1262,7 +1262,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
||||
int32 damage[3];
|
||||
int32 baseDamage[3];
|
||||
Field* fields = result->Fetch();
|
||||
uint64 caster_guid = fields[0].GetUInt64();
|
||||
ObjectGuid caster_guid(fields[0].GetUInt64());
|
||||
// NULL guid stored - pet is the caster of the spell - see Pet::_SaveAuras
|
||||
if (!caster_guid)
|
||||
caster_guid = GetGUID();
|
||||
@@ -1357,13 +1357,13 @@ void Pet::_SaveAuras(SQLTransaction& trans)
|
||||
}
|
||||
|
||||
// don't save guid of caster in case we are caster of the spell - guid for pet is generated every pet load, so it won't match saved guid anyways
|
||||
uint64 casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? 0 : itr->second->GetCasterGUID();
|
||||
ObjectGuid casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? ObjectGuid::Empty : itr->second->GetCasterGUID();
|
||||
|
||||
uint8 index = 0;
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA);
|
||||
stmt->setUInt32(index++, m_charmInfo->GetPetNumber());
|
||||
stmt->setUInt64(index++, casterGUID);
|
||||
stmt->setUInt64(index++, casterGUID.GetRawValue());
|
||||
stmt->setUInt32(index++, itr->second->GetId());
|
||||
stmt->setUInt8(index++, effMask);
|
||||
stmt->setUInt8(index++, recalculateMask);
|
||||
|
||||
Reference in new issue
Block a user