diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 03e281007..85b84be9a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5939,6 +5939,16 @@ void Player::SendInitialActionButtons() const DETAIL_LOG( "Action Buttons for '%u' spec '%u' Initialized", GetGUIDLow(), m_activeSpec ); } +void Player::SendLockActionButtons() const +{ + DETAIL_LOG( "Locking Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); + WorldPacket data(SMSG_ACTION_BUTTONS, 1); + // sending 2 locks actions bars, neither user can remove buttons, nor client removes buttons at spell unlearn + // they remain locked until server sends new action buttons + data << uint8(2); + GetSession()->SendPacket( &data ); +} + bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player, bool msg) { if(button >= MAX_ACTION_BUTTONS) @@ -12808,7 +12818,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) } case GOSSIP_OPTION_TRAINER: // pet trainers not have spells in fact now - /* FIXME: gossip menu with single unlearn pet talents option not show by some reason + /* FIXME: gossip menu with single unlearn pet talents option not show by some reason if (pCreature->GetCreatureInfo()->trainer_type == TRAINER_TYPE_PETS) hasMenuItem = false; else */ @@ -12820,7 +12830,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) hasMenuItem = false; break; case GOSSIP_OPTION_UNLEARNPETSKILLS: - if (pCreature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || pCreature->GetCreatureInfo()->trainer_class != CLASS_HUNTER) + if (pCreature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || pCreature->GetCreatureInfo()->trainer_class != CLASS_HUNTER) hasMenuItem = false; else if (Pet * pet = GetPet()) { @@ -22221,6 +22231,9 @@ void Player::ActivateSpec(uint8 specNum) UnsummonPetTemporaryIfAny(); + // prevent deletion of action buttons by client at spell unlearn or by player while spec change in progress + SendLockActionButtons(); + ApplyGlyphs(false); // copy of new talent spec (we will use it as model for converting current tlanet state to new) diff --git a/src/game/Player.h b/src/game/Player.h index e912be155..9283dd793 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1759,6 +1759,7 @@ class MANGOS_DLL_SPEC Player : public Unit ActionButton* addActionButton(uint8 spec, uint8 button, uint32 action, uint8 type); void removeActionButton(uint8 spec, uint8 button); void SendInitialActionButtons() const; + void SendLockActionButtons() const; ActionButton const* GetActionButton(uint8 button); PvPInfo pvpInfo; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2841f6e70..0c096a6fa 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10943" + #define REVISION_NR "10944" #endif // __REVISION_NR_H__