Core/Spells: mount results will now be stored in a pointer and sent outside of CheckCast
This commit is contained in:
1 parent
eb3e2f7ca5
commit
8fde6ce50a
2 files changed
+15
-5
No files matched your search
@@ -3208,8 +3208,9 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
|
||||
if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem || !m_caster->m_playerMovingMe)
|
||||
m_needComboPoints = false;
|
||||
|
||||
MountResult mountResult = MountResult::Ok;
|
||||
uint32 param1 = 0, param2 = 0;
|
||||
SpellCastResult result = CheckCast(true, ¶m1, ¶m2);
|
||||
SpellCastResult result = CheckCast(true, ¶m1, ¶m2, &mountResult);
|
||||
// target is checked in too many locations and with different results to handle each of them
|
||||
// handle just the general SPELL_FAILED_BAD_TARGETS result which is the default result for most DBC target checks
|
||||
if (_triggeredCastFlags & TRIGGERED_IGNORE_TARGET_CHECK && result == SPELL_FAILED_BAD_TARGETS)
|
||||
@@ -3226,6 +3227,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
|
||||
triggeredByAura->GetBase()->SetDuration(0);
|
||||
}
|
||||
|
||||
// Send mount result
|
||||
if (mountResult != MountResult::Ok)
|
||||
SendMountResult(mountResult);
|
||||
|
||||
if (param1 || param2)
|
||||
SendCastResult(result, ¶m1, ¶m2);
|
||||
else
|
||||
@@ -5365,7 +5370,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGoT
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
|
||||
SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/, MountResult* mountResult /*= mountResult*/)
|
||||
{
|
||||
// check death state
|
||||
if (!m_caster->IsAlive() && !m_spellInfo->IsPassive() && !(m_spellInfo->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
|
||||
@@ -6139,8 +6144,13 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
||||
|
||||
if (m_caster->IsInDisallowedMountForm())
|
||||
{
|
||||
SendMountResult(MountResult::Shapeshifted); // mount result gets sent before the cast result
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
if (mountResult)
|
||||
{
|
||||
*mountResult = MountResult::Shapeshifted;
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_NOT_SHAPESHIFT;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user