aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.h
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-04-28 16:08:31 +0200
committerMachiavelli <none@none>2010-04-28 16:08:31 +0200
commitab013e42c92065abe99b4e02b812fc5bdd009cca (patch)
treead304550a3df27b36eba245404503be4799a5275 /src/game/Player.h
parent311d108529917d2f5b7f19a0072760b350f14660 (diff)
Fix action buttons sent to client when swapping between talent specs. Storage related parts by Hunuza (MaNGOS), big thanks.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.h')
-rw-r--r--src/game/Player.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/game/Player.h b/src/game/Player.h
index 07334486852..a5f4e842933 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -167,11 +167,10 @@ enum ActionButtonType
struct ActionButton
{
- ActionButton() : packedData(0), uState(ACTIONBUTTON_NEW), canRemoveByClient(true){}
+ ActionButton() : packedData(0), uState(ACTIONBUTTON_NEW) {}
uint32 packedData;
ActionButtonUpdateState uState;
- bool canRemoveByClient;
// helpers
ActionButtonType GetType() const { return ActionButtonType(ACTION_BUTTON_TYPE(packedData)); }
@@ -1665,10 +1664,13 @@ class Player : public Unit, public GridObject<Player>
m_cinematic = cine;
}
- ActionButton* addActionButton(uint8 button, uint32 action, uint8 type);
- void removeActionButton(uint8 button);
- void SendInitialActionButtons() const { SendActionButtons(0); }
+ ActionButton* addActionButton(uint8 spec, uint8 button, uint32 action, uint8 type);
+ void removeActionButton(uint8 spec, uint8 button);
+ uint32 GetActionButtonSpell(uint8 button) const;
+ ActionButton const* GetActionButton(uint8 button);
+ void SendInitialActionButtons() const { SendActionButtons(1); }
void SendActionButtons(uint32 state) const;
+ bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type, Player* player, bool msg = true);
PvPInfo pvpInfo;
void UpdatePvPState(bool onlyFFA = false);
@@ -2336,11 +2338,6 @@ class Player : public Unit, public GridObject<Player>
//bool isActiveObject() const { return true; }
bool canSeeSpellClickOn(Creature const* creature) const;
- uint32 GetActionButtonSpell(uint8 button) const
- {
- ActionButtonList::const_iterator ab = m_actionButtons.find(button);
- return ab != m_actionButtons.end() && ab->second.uState != ACTIONBUTTON_DELETED && ab->second.GetType() == ACTION_BUTTON_SPELL ? ab->second.GetAction() : 0;
- }
uint32 GetChampioningFaction() const { return m_ChampioningFaction; }
void SetChampioningFaction(uint32 faction) { m_ChampioningFaction = faction; }
@@ -2485,7 +2482,7 @@ class Player : public Unit, public GridObject<Player>
uint32 m_Glyphs[MAX_TALENT_SPECS][MAX_GLYPH_SLOT_INDEX];
- ActionButtonList m_actionButtons;
+ ActionButtonList m_actionButtons[MAX_TALENT_SPECS];
float m_auraBaseMod[BASEMOD_END][MOD_END];
int16 m_baseRatingValue[MAX_COMBAT_RATING];