diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-08-25 00:27:37 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-08-25 00:44:33 +0200 |
| commit | d4ef2529e91043bc719c3238714413fd21c9005c (patch) | |
| tree | 08385d090a0ece4bd08fb5062be912cca63b7cc4 /src/server/game/Spells/Spell.cpp | |
| parent | cdf4040f4fce4f1e5ebb33525c4618845605081c (diff) | |
Core/Unit: Store charmer and charmed pointers on Unit directly, no more map lookups for Unit::GetCharmer and Unit::GetCharmed
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ec8b1202208..5329bee5c37 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3789,7 +3789,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->GetUInt32Value(UNIT_CREATED_BY_SPELL) == m_spellInfo->Id) @@ -5616,7 +5616,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint return SPELL_FAILED_ALREADY_HAVE_SUMMON; // intentional missing break, check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET case SUMMON_CATEGORY_PUPPET: - if (unitCaster->GetCharmGUID()) + if (unitCaster->GetCharmedGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; break; } @@ -5651,7 +5651,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint return SPELL_FAILED_ALREADY_HAVE_SUMMON; } - if (unitCaster->GetCharmGUID()) + if (unitCaster->GetCharmedGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; break; } @@ -5817,7 +5817,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && unitCaster->GetPetGUID()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; - if (unitCaster->GetCharmGUID()) + if (unitCaster->GetCharmedGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; } |
