diff options
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 81b7198b2e8..c31034fbcbb 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -444,7 +444,7 @@ void SpellCastTargets::RemoveDst() void SpellCastTargets::Update(Unit* caster) { - m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL; + m_objectTarget = !m_objectTargetGUID.IsEmpty() ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL; m_itemTarget = NULL; if (caster->GetTypeId() == TYPEID_PLAYER) @@ -462,7 +462,7 @@ void SpellCastTargets::Update(Unit* caster) } // update positions by transport move - if (HasSrc() && m_src._transportGUID) + if (HasSrc() && !m_src._transportGUID.IsEmpty()) { if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_src._transportGUID)) { @@ -471,7 +471,7 @@ void SpellCastTargets::Update(Unit* caster) } } - if (HasDst() && m_dst._transportGUID) + if (HasDst() && !m_dst._transportGUID.IsEmpty()) { if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dst._transportGUID)) { @@ -1648,7 +1648,7 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) { case SPELL_EFFECT_SUMMON_RAF_FRIEND: case SPELL_EFFECT_SUMMON_PLAYER: - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->GetTarget()) + if (m_caster->GetTypeId() == TYPEID_PLAYER && !m_caster->GetTarget().IsEmpty()) { WorldObject* target = ObjectAccessor::FindPlayer(m_caster->GetTarget()); @@ -3054,7 +3054,7 @@ void Spell::cast(bool skipCheck) } // cancel at lost explicit target during cast - if (m_targets.GetObjectTargetGUID() && !m_targets.GetObjectTarget()) + if (!m_targets.GetObjectTargetGUID().IsEmpty() && !m_targets.GetObjectTarget()) { cancel(); return; @@ -3481,7 +3481,7 @@ void Spell::update(uint32 difftime) return; } - if (m_targets.GetUnitTargetGUID() && !m_targets.GetUnitTarget()) + if (!m_targets.GetUnitTargetGUID().IsEmpty() && !m_targets.GetUnitTarget()) { TC_LOG_DEBUG("spells", "Spell %u is cancelled due to removal of target.", m_spellInfo->Id); cancel(); @@ -4005,7 +4005,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data) { if ((*ihit).missCondition == SPELL_MISS_NONE) // Add only hits { - *data << uint64(ihit->targetGUID); + *data << (ihit->targetGUID); m_channelTargetEffectMask |=ihit->effectMask; ++hit; } @@ -4013,7 +4013,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data) for (std::list<GOTargetInfo>::const_iterator ighit = m_UniqueGOTargetInfo.begin(); ighit != m_UniqueGOTargetInfo.end() && hit < 255; ++ighit) { - *data << uint64(ighit->targetGUID); // Always hits + *data << (ighit->targetGUID); // Always hits ++hit; } @@ -4024,7 +4024,7 @@ void Spell::WriteSpellGoTargets(WorldPacket* data) { if (ihit->missCondition != SPELL_MISS_NONE) // Add only miss { - *data << uint64(ihit->targetGUID); + *data << (ihit->targetGUID); *data << uint8(ihit->missCondition); if (ihit->missCondition == SPELL_MISS_REFLECT) *data << uint8(ihit->reflectResult); @@ -4654,7 +4654,7 @@ void Spell::HandleHolyPower(Player* caster) if (!m_powerCost || !modOwner) return; - if (uint64 targetGUID = m_targets.GetUnitTargetGUID()) + if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID()) { for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) { @@ -6426,7 +6426,7 @@ bool Spell::UpdatePointers() m_originalCaster = NULL; } - if (m_castItemGUID && m_caster->GetTypeId() == TYPEID_PLAYER) + if (!m_castItemGUID.IsEmpty() && m_caster->GetTypeId() == TYPEID_PLAYER) { m_CastItem = m_caster->ToPlayer()->GetItemByGuid(m_castItemGUID); // cast item not found, somehow the item is no longer where we expected |
