mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[11465] non-ObjectGuid guids in random places.
Only ChannelMgr code wide use uint64 guids now, and Map object stores.
This commit is contained in:
parent
a925db80fa
commit
ef6a48fe03
44 changed files with 219 additions and 215 deletions
|
|
@ -3745,7 +3745,7 @@ void Unit::SetFacingToObject(WorldObject* pObject)
|
|||
// TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
|
||||
|
||||
SetOrientation(GetAngle(pObject));
|
||||
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetGUID());
|
||||
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0, NULL, pObject->GetObjectGuid().GetRawValue());
|
||||
}
|
||||
|
||||
bool Unit::isInAccessablePlaceFor(Creature const* c) const
|
||||
|
|
@ -4747,8 +4747,11 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode)
|
|||
else
|
||||
delete holder;
|
||||
|
||||
if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) && caster && caster->GetGUID() != GetGUID())
|
||||
if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) &&
|
||||
caster && caster->GetObjectGuid() != GetObjectGuid())
|
||||
{
|
||||
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode)
|
||||
|
|
@ -4925,7 +4928,7 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const
|
|||
|
||||
void Unit::AddDynObject(DynamicObject* dynObj)
|
||||
{
|
||||
m_dynObjGUIDs.push_back(dynObj->GetGUID());
|
||||
m_dynObjGUIDs.push_back(dynObj->GetObjectGuid());
|
||||
}
|
||||
|
||||
void Unit::RemoveDynObject(uint32 spellid)
|
||||
|
|
@ -4953,8 +4956,7 @@ void Unit::RemoveAllDynObjects()
|
|||
{
|
||||
while(!m_dynObjGUIDs.empty())
|
||||
{
|
||||
DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin());
|
||||
if(dynObj)
|
||||
if (DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin()))
|
||||
dynObj->Delete();
|
||||
m_dynObjGUIDs.erase(m_dynObjGUIDs.begin());
|
||||
}
|
||||
|
|
@ -5325,15 +5327,12 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
|
|||
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(getFaction());
|
||||
if(!entry)
|
||||
{
|
||||
static uint64 guid = 0; // prevent repeating spam same faction problem
|
||||
static ObjectGuid guid; // prevent repeating spam same faction problem
|
||||
|
||||
if(GetGUID() != guid)
|
||||
if (GetObjectGuid() != guid)
|
||||
{
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
sLog.outError("Player %s have invalid faction (faction template id) #%u", ((Player*)this)->GetName(), getFaction());
|
||||
else
|
||||
sLog.outError("Creature (template id: %u) have invalid faction (faction template id) #%u", ((Creature*)this)->GetCreatureInfo()->Entry, getFaction());
|
||||
guid = GetGUID();
|
||||
sLog.outError("%s have invalid faction (faction template id) #%u", GetGuidStr().c_str(), getFaction());
|
||||
guid = GetObjectGuid();
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
|
|
@ -5955,30 +5954,29 @@ void Unit::SetCharm(Unit* pet)
|
|||
|
||||
void Unit::AddGuardian( Pet* pet )
|
||||
{
|
||||
m_guardianPets.insert(pet->GetGUID());
|
||||
m_guardianPets.insert(pet->GetObjectGuid());
|
||||
}
|
||||
|
||||
void Unit::RemoveGuardian( Pet* pet )
|
||||
{
|
||||
m_guardianPets.erase(pet->GetGUID());
|
||||
m_guardianPets.erase(pet->GetObjectGuid());
|
||||
}
|
||||
|
||||
void Unit::RemoveGuardians()
|
||||
{
|
||||
while(!m_guardianPets.empty())
|
||||
while (!m_guardianPets.empty())
|
||||
{
|
||||
uint64 guid = *m_guardianPets.begin();
|
||||
if(Pet* pet = GetMap()->GetPet(guid))
|
||||
if (Pet* pet = GetMap()->GetPet(*m_guardianPets.begin()))
|
||||
pet->Unsummon(PET_SAVE_AS_DELETED, this);
|
||||
|
||||
m_guardianPets.erase(guid);
|
||||
m_guardianPets.erase(m_guardianPets.begin());
|
||||
}
|
||||
}
|
||||
|
||||
Pet* Unit::FindGuardianWithEntry(uint32 entry)
|
||||
{
|
||||
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||
if(Pet* pet = GetMap()->GetPet(*itr))
|
||||
for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||
if (Pet* pet = GetMap()->GetPet(*itr))
|
||||
if (pet->GetEntry() == entry)
|
||||
return pet;
|
||||
|
||||
|
|
@ -5987,8 +5985,8 @@ Pet* Unit::FindGuardianWithEntry(uint32 entry)
|
|||
|
||||
Pet* Unit::GetProtectorPet()
|
||||
{
|
||||
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||
if(Pet* pet = GetMap()->GetPet(*itr))
|
||||
for (GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||
if (Pet* pet = GetMap()->GetPet(*itr))
|
||||
if (pet->getPetType() == PROTECTOR_PET)
|
||||
return pet;
|
||||
|
||||
|
|
@ -6354,7 +6352,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u
|
|||
// Twisted Faith
|
||||
case 7377:
|
||||
{
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetGUID()))
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetObjectGuid()))
|
||||
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||
break;
|
||||
}
|
||||
|
|
@ -6438,7 +6436,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u
|
|||
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000001))
|
||||
{
|
||||
// if Insect Swarm on target
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetGUID()))
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000200000), 0, GetObjectGuid()))
|
||||
{
|
||||
Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter)
|
||||
|
|
@ -6730,7 +6728,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
|||
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
|
||||
{
|
||||
// search for Moonfire on target
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetGUID()))
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000002), 0, GetObjectGuid()))
|
||||
{
|
||||
Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter)
|
||||
|
|
@ -6764,7 +6762,7 @@ bool Unit::IsSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
|||
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
|
||||
{
|
||||
// Flame Shock
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetGUID()))
|
||||
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetObjectGuid()))
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
|
@ -6947,7 +6945,7 @@ uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto,
|
|||
}
|
||||
case 7871: // Glyph of Lesser Healing Wave
|
||||
{
|
||||
if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetGUID()))
|
||||
if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetObjectGuid()))
|
||||
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||
break;
|
||||
}
|
||||
|
|
@ -10608,7 +10606,7 @@ void Unit::SendThreatUpdate()
|
|||
data << uint32(count);
|
||||
for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data.appendPackGUID((*itr)->getUnitGuid());
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
data << uint32((*itr)->getThreat());
|
||||
}
|
||||
SendMessageToSet(&data, false);
|
||||
|
|
@ -10623,11 +10621,11 @@ void Unit::SendHighestThreatUpdate(HostileReference* pHostilReference)
|
|||
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data.appendPackGUID(pHostilReference->getUnitGuid());
|
||||
data << pHostilReference->getUnitGuid().WriteAsPacked();
|
||||
data << uint32(count);
|
||||
for (ThreatList::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data.appendPackGUID((*itr)->getUnitGuid());
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
data << uint32((*itr)->getThreat());
|
||||
}
|
||||
SendMessageToSet(&data, false);
|
||||
|
|
@ -10647,7 +10645,7 @@ void Unit::SendThreatRemove(HostileReference* pHostileReference)
|
|||
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Send SMSG_THREAT_REMOVE Message");
|
||||
WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8);
|
||||
data << GetPackGUID();
|
||||
data.appendPackGUID(pHostileReference->getUnitGuid());
|
||||
data << pHostileReference->getUnitGuid().WriteAsPacked();
|
||||
SendMessageToSet(&data, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue