fix(Core/Spells): Fix Lock and Load procs (#24795)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-22 12:32:41 -06:00
committed by GitHub
parent 98cf3cb007
commit 96df2b3678
4 changed files with 22 additions and 1 deletions

View File

@@ -719,6 +719,7 @@ Spell::~Spell()
void Spell::InitExplicitTargets(SpellCastTargets const& targets)
{
m_targets = targets;
m_originalTargetGUID = targets.GetObjectTargetGUID();
// this function tries to correct spell explicit targets for spell
// client doesn't send explicit targets correctly sometimes - we need to fix such spells serverside
// this also makes sure that we correctly send explicit targets to client (removes redundant data)
@@ -7855,6 +7856,11 @@ void Spell::DelayedChannel()
SendChannelUpdate(m_timer);
}
Unit* Spell::GetOriginalTarget() const
{
return ObjectAccessor::GetUnit(*m_caster, m_originalTargetGUID);
}
bool Spell::UpdatePointers()
{
if (m_originalCasterGUID == m_caster->GetGUID())

View File

@@ -585,6 +585,7 @@ public:
Unit* GetCaster() const { return m_caster; }
Unit* GetOriginalCaster() const { return m_originalCaster; }
Unit* GetOriginalTarget() const;
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
int32 GetPowerCost() const { return m_powerCost; }
@@ -621,6 +622,8 @@ public:
// e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
ObjectGuid m_originalTargetGUID; // unit target saved before InitExplicitTargets strips it
Spell** m_selfContainer; // pointer to our spell container (if applicable)
std::string GetDebugInfo() const;