mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Map local guids 6.x -> 4.3.4
Ported the following commits:ca83e14f8bee1c1b97be18e4ab6911bf37446b3ccb854a2b7b
This commit is contained in:
@@ -212,10 +212,10 @@ ObjectGuid SpellCastTargets::GetOrigUnitTargetGUID() const
|
||||
{
|
||||
switch (m_origObjectTargetGUID.GetHigh())
|
||||
{
|
||||
case HIGHGUID_PLAYER:
|
||||
case HIGHGUID_VEHICLE:
|
||||
case HIGHGUID_UNIT:
|
||||
case HIGHGUID_PET:
|
||||
case HighGuid::Player:
|
||||
case HighGuid::Vehicle:
|
||||
case HighGuid::Unit:
|
||||
case HighGuid::Pet:
|
||||
return m_origObjectTargetGUID;
|
||||
default:
|
||||
return ObjectGuid();
|
||||
@@ -2224,6 +2224,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
uint8 mask = target->effectMask;
|
||||
|
||||
Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target->targetGUID);
|
||||
if (!unit && !target->targetGUID.IsPlayer()) // only players may be targeted across maps
|
||||
return;
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
uint8 farMask = 0;
|
||||
@@ -2236,7 +2239,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (!farMask)
|
||||
return;
|
||||
// find unit in world
|
||||
unit = ObjectAccessor::FindUnit(target->targetGUID);
|
||||
unit = ObjectAccessor::FindPlayer(target->targetGUID);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
@@ -3440,7 +3443,7 @@ void Spell::_handle_finish_phase()
|
||||
|
||||
if (m_caster->m_extraAttacks && m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
{
|
||||
if (Unit* victim = ObjectAccessor::FindUnit(m_targets.GetOrigUnitTargetGUID()))
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*m_caster, m_targets.GetOrigUnitTargetGUID()))
|
||||
m_caster->HandleProcExtraAttackFor(victim);
|
||||
else
|
||||
m_caster->m_extraAttacks = 0;
|
||||
@@ -3571,7 +3574,7 @@ void Spell::finish(bool ok)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
|
||||
if (spellInfo && spellInfo->SpellIconID == 2056)
|
||||
{
|
||||
TC_LOG_DEBUG("spells", "Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id);
|
||||
TC_LOG_DEBUG("spells", "Statue %d is unsummoned in spell %d finish", m_caster->GetGUID().GetCounter(), m_spellInfo->Id);
|
||||
m_caster->setDeathState(JUST_DIED);
|
||||
return;
|
||||
}
|
||||
@@ -4277,7 +4280,7 @@ void Spell::TakeCastItem()
|
||||
{
|
||||
// This code is to avoid a crash
|
||||
// I'm not sure, if this is really an error, but I guess every item needs a prototype
|
||||
TC_LOG_ERROR("spells", "Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow());
|
||||
TC_LOG_ERROR("spells", "Cast item has no item prototype %s", m_CastItem->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6644,7 +6647,7 @@ SpellEvent::~SpellEvent()
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("spells", "~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
|
||||
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
|
||||
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUID().GetCounter(), m_Spell->m_spellInfo->Id);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user