diff options
| author | thenecromancer <none@none> | 2010-01-13 09:45:05 +0100 |
|---|---|---|
| committer | thenecromancer <none@none> | 2010-01-13 09:45:05 +0100 |
| commit | 44e2bfce778d5ccc0b4c7eb1d8383eb23491eb18 (patch) | |
| tree | dce7dbdbc969ae19c291e531fc4a5d9cb6cf6b2f | |
| parent | 93e6fcfc1be367206c4a85c4c233d763481eacd3 (diff) | |
Fix problems with action buttons related to switching specs
*saving spells without saving current talent map and m_activeSpec is not good idea at all,
this might allow players various exploits
*send expected packet to correctly handle action bar
--HG--
branch : trunk
| -rw-r--r-- | src/game/Player.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 94d4387f8e7..993ed90dbc9 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5862,13 +5862,16 @@ void Player::SendActionButtons(uint32 state) const WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); data << uint8(state); // can be 0, 1, 2 - for (uint16 button = 0; button < MAX_ACTION_BUTTONS; ++button) + if (state != 2) { - ActionButtonList::const_iterator itr = m_actionButtons.find(button); - if (itr != m_actionButtons.end() && itr->second.uState != ACTIONBUTTON_DELETED) - data << uint32(itr->second.packedData); - else - data << uint32(0); + for (uint16 button = 0; button < MAX_ACTION_BUTTONS; ++button) + { + ActionButtonList::const_iterator itr = m_actionButtons.find(button); + if (itr != m_actionButtons.end() && itr->second.uState != ACTIONBUTTON_DELETED) + data << uint32(itr->second.packedData); + else + data << uint32(0); + } } GetSession()->SendPacket(&data); @@ -23006,8 +23009,8 @@ void Player::ActivateSpec(uint8 spec) m_usedTalentCount = spentTalents; InitTalentForLevel(); - _SaveSpells(); - + // Let client clear his current Actions + SendActionButtons(2);
m_actionButtons.clear(); if (QueryResult *result = CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec)) _LoadActions(result, false); |
