aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-08-25 00:27:37 +0200
committerShauren <shauren.trinity@gmail.com>2021-10-23 00:11:44 +0200
commita5989dcee9150565e7f4b8e3f7a62a414a484a3f (patch)
treee20ec1eeddf0857b1f44fa045a8ed40a72081ab7 /src/server/game/Spells/Spell.cpp
parentab95c5e9d7b848716e1c9432754f29c65cdb9382 (diff)
Core/Unit: Store charmer and charmed pointers on Unit directly, no more map lookups for Unit::GetCharmer and Unit::GetCharmed
(cherry picked from commit d4ef2529e91043bc719c3238714413fd21c9005c)
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 22a1b24329c..aacba1e1f30 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3932,7 +3932,7 @@ void Spell::finish(bool ok)
// Unsummon summon as possessed creatures on spell cancel
if (m_spellInfo->IsChanneled() && unitCaster->GetTypeId() == TYPEID_PLAYER)
{
- if (Unit* charm = unitCaster->GetCharm())
+ if (Unit* charm = unitCaster->GetCharmed())
if (charm->GetTypeId() == TYPEID_UNIT
&& charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_PUPPET)
&& charm->m_unitData->CreatedBySpell == int32(m_spellInfo->Id))
@@ -5784,7 +5784,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
/* fallthrough */
// intentional, check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET
case SUMMON_CATEGORY_PUPPET:
- if (!unitCaster->GetCharmGUID().IsEmpty())
+ if (!unitCaster->GetCharmedGUID().IsEmpty())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
break;
}
@@ -5821,7 +5821,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
}
- if (!unitCaster->GetCharmGUID().IsEmpty())
+ if (!unitCaster->GetCharmedGUID().IsEmpty())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
break;
}
@@ -6021,7 +6021,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && !unitCaster->GetPetGUID().IsEmpty())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
- if (!unitCaster->GetCharmGUID().IsEmpty())
+ if (!unitCaster->GetCharmedGUID().IsEmpty())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
}