diff options
| author | megamage <none@none> | 2009-07-01 18:07:20 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-07-01 18:07:20 -0500 |
| commit | e1d93bd00f676701b1de87f86a1f2fc5cfc11438 (patch) | |
| tree | 092bc22e10ba60a13b5bf04ee351f614d8679b4c /src/game/MiscHandler.cpp | |
| parent | 8122a15f467a8493cd5c49decc4fe09499b78af4 (diff) | |
*Backup your DB!
[8098] Support uint32 spell ids in code. Author: VladimirMangos
* Propertly work with uint32 spell ids in player action bar
* Fix in same time bug with not save equipment set button with id==0
* Merge misc field in character_action and playercreateinfo_action to action field as 3 byte
* Propertly load uint32 spell ids from character_spell
* Fixed types for some pet/creature related structure for spell id storing.
--HG--
branch : trunk
Diffstat (limited to 'src/game/MiscHandler.cpp')
| -rw-r--r-- | src/game/MiscHandler.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index f5a1013f085..3ba7f81a8c2 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1040,40 +1040,41 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) CHECK_PACKET_SIZE(recv_data,1+2+1+1); sLog.outDebug( "WORLD: Received CMSG_SET_ACTION_BUTTON" ); - uint8 button, misc, type; - uint16 action; - recv_data >> button >> action >> misc >> type; - sLog.outDetail( "BUTTON: %u ACTION: %u TYPE: %u MISC: %u", button, action, type, misc ); - if(action==0) + uint8 button; + uint32 packetData; + recv_data >> button >> packetData; + + uint32 action = ACTION_BUTTON_ACTION(packetData); + uint8 type = ACTION_BUTTON_TYPE(packetData); + + sLog.outDetail( "BUTTON: %u ACTION: %u TYPE: %u", button, action, type ); + if (!packetData) { sLog.outDetail( "MISC: Remove action from button %u", button ); - GetPlayer()->removeActionButton(button); } else { - if(type==ACTION_BUTTON_MACRO || type==ACTION_BUTTON_CMACRO) - { - sLog.outDetail( "MISC: Added Macro %u into button %u", action, button ); - GetPlayer()->addActionButton(button,action,type,misc); - } - else if(type==ACTION_BUTTON_EQSET) - { - sLog.outDetail( "MISC: Added EquipmentSet %u into button %u", action, button ); - GetPlayer()->addActionButton(button,action,type,misc); - } - else if(type==ACTION_BUTTON_SPELL) + switch(type) { - sLog.outDetail( "MISC: Added Spell %u into button %u", action, button ); - GetPlayer()->addActionButton(button,action,type,misc); - } - else if(type==ACTION_BUTTON_ITEM) - { - sLog.outDetail( "MISC: Added Item %u into button %u", action, button ); - GetPlayer()->addActionButton(button,action,type,misc); + case ACTION_BUTTON_MACRO: + case ACTION_BUTTON_CMACRO: + sLog.outDetail( "MISC: Added Macro %u into button %u", action, button ); + break; + case ACTION_BUTTON_EQSET: + sLog.outDetail( "MISC: Added EquipmentSet %u into button %u", action, button ); + break; + case ACTION_BUTTON_SPELL: + sLog.outDetail( "MISC: Added Spell %u into button %u", action, button ); + break; + case ACTION_BUTTON_ITEM: + sLog.outDetail( "MISC: Added Item %u into button %u", action, button ); + break; + default: + sLog.outError( "MISC: Unknown action button type %u for action %u into button %u", type, action, button ); + return; } - else - sLog.outError( "MISC: Unknown action button type %u for action %u into button %u", type, action, button ); + GetPlayer()->addActionButton(button,action,type); } } |
