mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Spells: Changed Spell::SendCastResult arguments to signed ints to match packet structure
This commit is contained in:
@@ -3106,7 +3106,7 @@ void Spell::prepare(SpellCastTargets const& targets, AuraEffect const* triggered
|
||||
if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem)
|
||||
m_needComboPoints = false;
|
||||
|
||||
uint32 param1 = 0, param2 = 0;
|
||||
int32 param1 = 0, param2 = 0;
|
||||
SpellCastResult result = CheckCast(true, ¶m1, ¶m2);
|
||||
// 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
|
||||
@@ -3340,7 +3340,7 @@ void Spell::_cast(bool skipCheck)
|
||||
// skip check if done already (for instant cast spells for example)
|
||||
if (!skipCheck)
|
||||
{
|
||||
auto cleanupSpell = [this, modOwner](SpellCastResult res, uint32* p1 = nullptr, uint32* p2 = nullptr)
|
||||
auto cleanupSpell = [this, modOwner](SpellCastResult res, int32* p1 = nullptr, int32* p2 = nullptr)
|
||||
{
|
||||
SendCastResult(res, p1, p2);
|
||||
SendInterrupted(0);
|
||||
@@ -3352,7 +3352,7 @@ void Spell::_cast(bool skipCheck)
|
||||
SetExecutedCurrently(false);
|
||||
};
|
||||
|
||||
uint32 param1 = 0, param2 = 0;
|
||||
int32 param1 = 0, param2 = 0;
|
||||
SpellCastResult castResult = CheckCast(false, ¶m1, ¶m2);
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
{
|
||||
@@ -3984,7 +3984,7 @@ void Spell::finish(bool ok)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void FillSpellCastFailedArgs(T& packet, ObjectGuid castId, SpellInfo const* spellInfo, SpellCastResult result, SpellCustomErrors customError, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/, Player* caster)
|
||||
inline void FillSpellCastFailedArgs(T& packet, ObjectGuid castId, SpellInfo const* spellInfo, SpellCastResult result, SpellCustomErrors customError, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/, Player* caster)
|
||||
{
|
||||
packet.CastID = castId;
|
||||
packet.SpellID = spellInfo->Id;
|
||||
@@ -4183,7 +4183,7 @@ inline void FillSpellCastFailedArgs(T& packet, ObjectGuid castId, SpellInfo cons
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::SendCastResult(SpellCastResult result, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/) const
|
||||
void Spell::SendCastResult(SpellCastResult result, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/) const
|
||||
{
|
||||
if (result == SPELL_CAST_OK)
|
||||
return;
|
||||
@@ -4203,7 +4203,7 @@ void Spell::SendCastResult(SpellCastResult result, uint32* param1 /*= nullptr*/,
|
||||
m_caster->ToPlayer()->SendDirectMessage(castFailed.Write());
|
||||
}
|
||||
|
||||
void Spell::SendPetCastResult(SpellCastResult result, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/) const
|
||||
void Spell::SendPetCastResult(SpellCastResult result, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/) const
|
||||
{
|
||||
if (result == SPELL_CAST_OK)
|
||||
return;
|
||||
@@ -4220,7 +4220,7 @@ void Spell::SendPetCastResult(SpellCastResult result, uint32* param1 /*= nullptr
|
||||
owner->ToPlayer()->SendDirectMessage(petCastFailed.Write());
|
||||
}
|
||||
|
||||
void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
|
||||
void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/)
|
||||
{
|
||||
if (result == SPELL_CAST_OK)
|
||||
return;
|
||||
@@ -5103,7 +5103,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
|
||||
SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/)
|
||||
{
|
||||
// check death state
|
||||
if (m_caster->ToUnit() && !m_caster->ToUnit()->IsAlive() && !m_spellInfo->IsPassive() && !(m_spellInfo->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
|
||||
@@ -6162,7 +6162,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
return CheckCast(true);
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
|
||||
SpellCastResult Spell::CheckCasterAuras(int32* param1) const
|
||||
{
|
||||
Unit* unitCaster = (m_originalCaster ? m_originalCaster : m_caster->ToUnit());
|
||||
if (!unitCaster)
|
||||
@@ -6291,7 +6291,7 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsAuraEffect(AuraType auraType, uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsAuraEffect(AuraType auraType, int32* param1) const
|
||||
{
|
||||
Unit* unitCaster = (m_originalCaster ? m_originalCaster : m_caster->ToUnit());
|
||||
if (!unitCaster)
|
||||
@@ -6320,42 +6320,42 @@ bool Spell::CheckSpellCancelsAuraEffect(AuraType auraType, uint32* param1) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsCharm(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsCharm(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_CHARM, param1) &&
|
||||
CheckSpellCancelsAuraEffect(SPELL_AURA_AOE_CHARM, param1) &&
|
||||
CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_POSSESS, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsStun(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsStun(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_STUN, param1) &&
|
||||
CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_STUN_DISABLE_GRAVITY, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsSilence(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsSilence(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_SILENCE, param1) &&
|
||||
CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY_SILENCE, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsPacify(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsPacify(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY, param1) &&
|
||||
CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_PACIFY_SILENCE, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsFear(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsFear(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_FEAR, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsConfuse(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsConfuse(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_CONFUSE, param1);
|
||||
}
|
||||
|
||||
bool Spell::CheckSpellCancelsNoActions(uint32* param1) const
|
||||
bool Spell::CheckSpellCancelsNoActions(int32* param1) const
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(SPELL_AURA_MOD_NO_ACTIONS, param1);
|
||||
}
|
||||
@@ -6608,7 +6608,7 @@ SpellCastResult Spell::CheckPower() const
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/) const
|
||||
SpellCastResult Spell::CheckItems(int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/) const
|
||||
{
|
||||
Player* player = m_caster->ToPlayer();
|
||||
if (!player)
|
||||
|
||||
@@ -438,7 +438,7 @@ class TC_GAME_API Spell
|
||||
void TakeReagents();
|
||||
void TakeCastItem();
|
||||
|
||||
SpellCastResult CheckCast(bool strict, uint32* param1 = nullptr, uint32* param2 = nullptr);
|
||||
SpellCastResult CheckCast(bool strict, int32* param1 = nullptr, int32* param2 = nullptr);
|
||||
SpellCastResult CheckPetCast(Unit* target);
|
||||
|
||||
// handlers
|
||||
@@ -448,21 +448,21 @@ class TC_GAME_API Spell
|
||||
void _handle_immediate_phase();
|
||||
void _handle_finish_phase();
|
||||
|
||||
SpellCastResult CheckItems(uint32* param1, uint32* param2) const;
|
||||
SpellCastResult CheckItems(int32* param1, int32* param2) const;
|
||||
SpellCastResult CheckRange(bool strict) const;
|
||||
SpellCastResult CheckPower() const;
|
||||
SpellCastResult CheckRuneCost() const;
|
||||
SpellCastResult CheckCasterAuras(uint32* param1) const;
|
||||
SpellCastResult CheckCasterAuras(int32* param1) const;
|
||||
SpellCastResult CheckArenaAndRatedBattlegroundCastRules();
|
||||
|
||||
bool CheckSpellCancelsAuraEffect(AuraType auraType, uint32* param1) const;
|
||||
bool CheckSpellCancelsCharm(uint32* param1) const;
|
||||
bool CheckSpellCancelsStun(uint32* param1) const;
|
||||
bool CheckSpellCancelsSilence(uint32* param1) const;
|
||||
bool CheckSpellCancelsPacify(uint32* param1) const;
|
||||
bool CheckSpellCancelsFear(uint32* param1) const;
|
||||
bool CheckSpellCancelsConfuse(uint32* param1) const;
|
||||
bool CheckSpellCancelsNoActions(uint32* param1) const;
|
||||
bool CheckSpellCancelsAuraEffect(AuraType auraType, int32* param1) const;
|
||||
bool CheckSpellCancelsCharm(int32* param1) const;
|
||||
bool CheckSpellCancelsStun(int32* param1) const;
|
||||
bool CheckSpellCancelsSilence(int32* param1) const;
|
||||
bool CheckSpellCancelsPacify(int32* param1) const;
|
||||
bool CheckSpellCancelsFear(int32* param1) const;
|
||||
bool CheckSpellCancelsConfuse(int32* param1) const;
|
||||
bool CheckSpellCancelsNoActions(int32* param1) const;
|
||||
|
||||
int32 CalculateDamage(SpellEffectInfo const& spellEffectInfo, Unit const* target, float* var = nullptr) const;
|
||||
|
||||
@@ -480,9 +480,9 @@ class TC_GAME_API Spell
|
||||
void CheckSrc();
|
||||
void CheckDst();
|
||||
|
||||
static void SendCastResult(Player* caster, SpellInfo const* spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE, uint32* param1 = nullptr, uint32* param2 = nullptr);
|
||||
void SendCastResult(SpellCastResult result, uint32* param1 = nullptr, uint32* param2 = nullptr) const;
|
||||
void SendPetCastResult(SpellCastResult result, uint32* param1 = nullptr, uint32* param2 = nullptr) const;
|
||||
static void SendCastResult(Player* caster, SpellInfo const* spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE, int32* param1 = nullptr, int32* param2 = nullptr);
|
||||
void SendCastResult(SpellCastResult result, int32* param1 = nullptr, int32* param2 = nullptr) const;
|
||||
void SendPetCastResult(SpellCastResult result, int32* param1 = nullptr, int32* param2 = nullptr) const;
|
||||
void SendMountResult(MountResult result);
|
||||
void SendSpellStart();
|
||||
void SendSpellGo();
|
||||
|
||||
@@ -753,7 +753,7 @@ SpellInfo const* SpellScript::GetTriggeringSpell() const
|
||||
return m_spell->m_triggeredByAuraSpell;
|
||||
}
|
||||
|
||||
void SpellScript::FinishCast(SpellCastResult result, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
|
||||
void SpellScript::FinishCast(SpellCastResult result, int32* param1 /*= nullptr*/, int32* param2 /*= nullptr*/)
|
||||
{
|
||||
m_spell->SendCastResult(result, param1, param2);
|
||||
m_spell->finish(result == SPELL_CAST_OK);
|
||||
|
||||
@@ -504,7 +504,7 @@ class TC_GAME_API SpellScript : public _SpellScript
|
||||
SpellInfo const* GetTriggeringSpell() const;
|
||||
|
||||
// finishes spellcast prematurely with selected error message
|
||||
void FinishCast(SpellCastResult result, uint32* param1 = nullptr, uint32* param2 = nullptr);
|
||||
void FinishCast(SpellCastResult result, int32* param1 = nullptr, int32* param2 = nullptr);
|
||||
|
||||
void SetCustomCastResultMessage(SpellCustomErrors result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user