fix(Core/Spells): Fix Vanish/Shadowmeld not absorbing spells via Sanctuary (#24937)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: linencloth <none@none>
This commit is contained in:
blinkysc
2026-02-28 11:46:56 -06:00
committed by GitHub
parent fe06e3fbd4
commit 8298e73057

View File

@@ -2559,11 +2559,15 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
if (effectUnit->IsAlive() != target->alive)
return;
// Xinef: absorb delayed projectiles for 500ms
if (getState() == SPELL_STATE_DELAYED && !m_spellInfo->IsTargetingArea() && !m_spellInfo->IsPositive() &&
(GameTime::GetGameTimeMS().count() - target->timeDelay) <= effectUnit->m_lastSanctuaryTime && GameTime::GetGameTimeMS().count() < (effectUnit->m_lastSanctuaryTime + 500) &&
effectUnit->FindMap() && !effectUnit->FindMap()->IsDungeon()
)
// Absorb delayed projectiles launched before Sanctuary (e.g. Vanish dodging a Frostbolt in flight)
if (getState() == SPELL_STATE_DELAYED && !m_spellInfo->IsPositive() &&
(GameTime::GetGameTimeMS().count() - target->timeDelay) <= effectUnit->m_lastSanctuaryTime)
return; // No missinfo in that case
// Absorb instant hostile spells on application within brief window after Sanctuary
if (getState() != SPELL_STATE_DELAYED && !m_spellInfo->IsPositive() &&
effectUnit->m_lastSanctuaryTime &&
GameTime::GetGameTimeMS().count() <= (effectUnit->m_lastSanctuaryTime + 400))
return; // No missinfo in that case
// Get original caster (if exist) and calculate damage/healing from him data