mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
fix(Core/Spells): Resolve invalid spell casts on dead players when the cast is valid. (#20712)
* Initial fix for #20509 * small revert * Two way visibility between ghosts. * clean up temporary changes. * clean up debug code. * small typo * revert .gitignore * fix codestyle * Add missing flag, resolve issue where cast was failing while alive. * Update SpellInfo.cpp Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --------- Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -1775,13 +1775,11 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
|
||||
// only spells with SPELL_ATTR3_ONLY_ON_GHOSTS can target ghosts
|
||||
if (((IsRequiringDeadTarget() != 0) != unitTarget->HasAuraType(SPELL_AURA_GHOST)) && !(IsDeathPersistent() && IsAllowingDeadTarget()))
|
||||
{
|
||||
if (AttributesEx3 & SPELL_ATTR3_ONLY_ON_GHOSTS)
|
||||
return SPELL_FAILED_TARGET_NOT_GHOST;
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
if (IsRequiringDeadTarget() && !unitTarget->HasAuraType(SPELL_AURA_GHOST))
|
||||
return SPELL_FAILED_TARGET_NOT_GHOST;
|
||||
|
||||
if (!IsDeathPersistent() && !IsAllowingDeadTarget())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (caster != unitTarget)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user