[10630] Convert Set(Get)ChannelObjectGuid to ObjectGuid way.

Also fix typo in debug output for prev. commit.
This commit is contained in:
VladimirMangos 2010-10-20 08:49:27 +04:00
parent 31c9efd219
commit da07caba28
6 changed files with 10 additions and 11 deletions

View file

@ -15356,14 +15356,13 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
std::string taxi_nodes = fields[37].GetCppString(); std::string taxi_nodes = fields[37].GetCppString();
// clear channel spell data (if saved at channel spell casting) // clear channel spell data (if saved at channel spell casting)
SetChannelObjectGUID(0); SetChannelObjectGuid(ObjectGuid());
SetUInt32Value(UNIT_CHANNEL_SPELL,0); SetUInt32Value(UNIT_CHANNEL_SPELL,0);
// clear charm/summon related fields // clear charm/summon related fields
SetCharm(NULL); SetCharm(NULL);
SetPet(NULL); SetPet(NULL);
SetTargetGuid(ObjectGuid()); SetTargetGuid(ObjectGuid());
SetChannelObjectGUID(0);
SetCharmerGUID(0); SetCharmerGUID(0);
SetOwnerGUID(0); SetOwnerGUID(0);
SetCreatorGUID(0); SetCreatorGUID(0);

View file

@ -3808,12 +3808,12 @@ void Spell::SendChannelUpdate(uint32 time)
{ {
m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
ObjectGuid target_guid = m_caster->GetChannelObjectGUID(); ObjectGuid target_guid = m_caster->GetChannelObjectGuid();
if (target_guid != m_caster->GetObjectGuid() && target_guid.IsUnit()) if (target_guid != m_caster->GetObjectGuid() && target_guid.IsUnit())
if (Unit* target = ObjectAccessor::GetUnit(*m_caster, target_guid)) if (Unit* target = ObjectAccessor::GetUnit(*m_caster, target_guid))
target->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); target->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
m_caster->SetChannelObjectGUID(0); m_caster->SetChannelObjectGuid(ObjectGuid());
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0); m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
} }
@ -3861,7 +3861,7 @@ void Spell::SendChannelStart(uint32 duration)
m_timer = duration; m_timer = duration;
if (target) if (target)
m_caster->SetChannelObjectGUID(target->GetGUID()); m_caster->SetChannelObjectGuid(target->GetObjectGuid());
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, m_spellInfo->Id); m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, m_spellInfo->Id);
} }

View file

@ -6892,7 +6892,7 @@ void Aura::PeriodicTick()
// ignore non positive values (can be result apply spellmods to aura damage // ignore non positive values (can be result apply spellmods to aura damage
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0; uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %s energize %s (TypeId: %u) for %u dmg inflicted by %u", DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %s energize %s for %u dmg inflicted by %u",
GetCasterGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str(), pdamage, GetId()); GetCasterGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str(), pdamage, GetId());
if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS) if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS)
@ -8885,7 +8885,7 @@ void SpellAuraHolder::Update(uint32 diff)
} }
// need check distance for channeled target only // need check distance for channeled target only
if (caster->GetChannelObjectGUID() == m_target->GetGUID()) if (caster->GetChannelObjectGuid() == m_target->GetObjectGuid())
{ {
// Get spell range // Get spell range
float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex)); float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex));

View file

@ -7774,7 +7774,7 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx)
{ {
case GAMEOBJECT_TYPE_FISHINGNODE: case GAMEOBJECT_TYPE_FISHINGNODE:
{ {
m_caster->SetChannelObjectGUID(pGameObj->GetGUID()); m_caster->SetChannelObjectGuid(pGameObj->GetObjectGuid());
m_caster->AddGameObject(pGameObj); // will removed at spell cancel m_caster->AddGameObject(pGameObj); // will removed at spell cancel
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo)) // end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo))

View file

@ -1485,8 +1485,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void SetCharmGUID(uint64 charm) { SetUInt64Value(UNIT_FIELD_CHARM, charm); } void SetCharmGUID(uint64 charm) { SetUInt64Value(UNIT_FIELD_CHARM, charm); }
ObjectGuid const& GetTargetGuid() const { return GetGuidValue(UNIT_FIELD_TARGET); } ObjectGuid const& GetTargetGuid() const { return GetGuidValue(UNIT_FIELD_TARGET); }
void SetTargetGuid(ObjectGuid targetGuid) { SetGuidValue(UNIT_FIELD_TARGET, targetGuid); } void SetTargetGuid(ObjectGuid targetGuid) { SetGuidValue(UNIT_FIELD_TARGET, targetGuid); }
uint64 GetChannelObjectGUID() const { return GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT); } ObjectGuid const& GetChannelObjectGuid() const { return GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT); }
void SetChannelObjectGUID(uint64 targetGuid) { SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, targetGuid); } void SetChannelObjectGuid(ObjectGuid targetGuid) { SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, targetGuid); }
uint64 GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); } uint64 GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); }
uint64 GetCharmerOrOwnerOrOwnGUID() const uint64 GetCharmerOrOwnerOrOwnGUID() const

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10629" #define REVISION_NR "10630"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__