mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[10636] Implement server side check combo points req. for spell cast.
Thanks to nos4r2zod for problem research.
This commit is contained in:
parent
7a26fdd45d
commit
691412d05c
7 changed files with 35 additions and 29 deletions
|
|
@ -430,7 +430,6 @@ Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m
|
|||
if(GetSession()->GetSecurity() == SEC_PLAYER)
|
||||
SetAcceptWhispers(true);
|
||||
|
||||
m_comboTarget = 0;
|
||||
m_comboPoints = 0;
|
||||
|
||||
m_usedTalentCount = 0;
|
||||
|
|
@ -6900,14 +6899,14 @@ void Player::DuelComplete(DuelCompleteType type)
|
|||
RemoveAurasDueToSpell(auras2remove[i]);
|
||||
|
||||
// cleanup combo points
|
||||
if(GetComboTarget()==duel->opponent->GetGUID())
|
||||
if (GetComboTargetGuid() == duel->opponent->GetObjectGuid())
|
||||
ClearComboPoints();
|
||||
else if(GetComboTarget()==duel->opponent->GetPetGUID())
|
||||
else if (GetComboTargetGuid().GetRawValue() == duel->opponent->GetPetGUID())
|
||||
ClearComboPoints();
|
||||
|
||||
if(duel->opponent->GetComboTarget()==GetGUID())
|
||||
if (duel->opponent->GetComboTargetGuid() == GetObjectGuid())
|
||||
duel->opponent->ClearComboPoints();
|
||||
else if(duel->opponent->GetComboTarget()==GetPetGUID())
|
||||
else if (duel->opponent->GetComboTargetGuid().GetRawValue() == GetPetGUID())
|
||||
duel->opponent->ClearComboPoints();
|
||||
|
||||
//cleanups
|
||||
|
|
@ -19448,7 +19447,7 @@ void Player::InitPrimaryProfessions()
|
|||
|
||||
void Player::SendComboPoints()
|
||||
{
|
||||
Unit *combotarget = ObjectAccessor::GetUnit(*this, m_comboTarget);
|
||||
Unit *combotarget = ObjectAccessor::GetUnit(*this, m_comboTargetGuid);
|
||||
if (combotarget)
|
||||
{
|
||||
WorldPacket data(SMSG_UPDATE_COMBO_POINTS, combotarget->GetPackGUID().size()+1);
|
||||
|
|
@ -19466,17 +19465,17 @@ void Player::AddComboPoints(Unit* target, int8 count)
|
|||
// without combo points lost (duration checked in aura)
|
||||
RemoveSpellsCausingAura(SPELL_AURA_RETAIN_COMBO_POINTS);
|
||||
|
||||
if(target->GetGUID() == m_comboTarget)
|
||||
if(target->GetObjectGuid() == m_comboTargetGuid)
|
||||
{
|
||||
m_comboPoints += count;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_comboTarget)
|
||||
if(Unit* target2 = ObjectAccessor::GetUnit(*this,m_comboTarget))
|
||||
if (!m_comboTargetGuid.IsEmpty())
|
||||
if(Unit* target2 = ObjectAccessor::GetUnit(*this, m_comboTargetGuid))
|
||||
target2->RemoveComboPointHolder(GetGUIDLow());
|
||||
|
||||
m_comboTarget = target->GetGUID();
|
||||
m_comboTargetGuid = target->GetObjectGuid();
|
||||
m_comboPoints = count;
|
||||
|
||||
target->AddComboPointHolder(GetGUIDLow());
|
||||
|
|
@ -19490,7 +19489,7 @@ void Player::AddComboPoints(Unit* target, int8 count)
|
|||
|
||||
void Player::ClearComboPoints()
|
||||
{
|
||||
if(!m_comboTarget)
|
||||
if (m_comboTargetGuid.IsEmpty())
|
||||
return;
|
||||
|
||||
// without combopoints lost (duration checked in aura)
|
||||
|
|
@ -19500,10 +19499,10 @@ void Player::ClearComboPoints()
|
|||
|
||||
SendComboPoints();
|
||||
|
||||
if(Unit* target = ObjectAccessor::GetUnit(*this,m_comboTarget))
|
||||
if(Unit* target = ObjectAccessor::GetUnit(*this,m_comboTargetGuid))
|
||||
target->RemoveComboPointHolder(GetGUIDLow());
|
||||
|
||||
m_comboTarget = 0;
|
||||
m_comboTargetGuid.Clear();
|
||||
}
|
||||
|
||||
void Player::SetGroup(Group *group, int8 subgroup)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue