diff options
author | n0n4m3 <none@none> | 2009-12-17 18:25:50 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2009-12-17 18:25:50 +0100 |
commit | 62d70b362806fee997900e79a4211ac5accecf72 (patch) | |
tree | 644d90683e2f38529f64a129e1cb80fc4356567f /src/game/PetHandler.cpp | |
parent | fa86c69c49199171cc36e441a9816918f0d576bc (diff) |
[9009] More fixes in pet action bar buttons swap.
--HG--
branch : trunk
Diffstat (limited to 'src/game/PetHandler.cpp')
-rw-r--r-- | src/game/PetHandler.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 5b9b1a3fa14..1b2503eed0b 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -428,22 +428,28 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) } } - // check swap + // check swap (at command->spell swap client remove spell first in another packet, so check only command move correctness) if (move_command) { uint8 act_state_0 = UNIT_ACTION_BUTTON_TYPE(data[0]); - uint32 spell_id_0 = UNIT_ACTION_BUTTON_ACTION(data[0]); - UnitActionBarEntry const* actionEntry_1 = charmInfo->GetActionBarEntry(position[1]); - if (!actionEntry_1 || spell_id_0 != actionEntry_1->GetAction() || - act_state_0 != actionEntry_1->GetType()) - return; + if(act_state_0 == ACT_COMMAND || act_state_0 == ACT_REACTION) + { + uint32 spell_id_0 = UNIT_ACTION_BUTTON_ACTION(data[0]); + UnitActionBarEntry const* actionEntry_1 = charmInfo->GetActionBarEntry(position[1]); + if (!actionEntry_1 || spell_id_0 != actionEntry_1->GetAction() || + act_state_0 != actionEntry_1->GetType()) + return; + } uint8 act_state_1 = UNIT_ACTION_BUTTON_TYPE(data[1]); - uint32 spell_id_1 = UNIT_ACTION_BUTTON_ACTION(data[1]); - UnitActionBarEntry const* actionEntry_0 = charmInfo->GetActionBarEntry(position[0]); - if (!actionEntry_0 || spell_id_1 != actionEntry_0->GetAction() || - act_state_1 != actionEntry_0->GetType()) - return; + if(act_state_1 == ACT_COMMAND || act_state_1 == ACT_REACTION) + { + uint32 spell_id_1 = UNIT_ACTION_BUTTON_ACTION(data[1]); + UnitActionBarEntry const* actionEntry_0 = charmInfo->GetActionBarEntry(position[0]); + if (!actionEntry_0 || spell_id_1 != actionEntry_0->GetAction() || + act_state_1 != actionEntry_0->GetType()) + return; + } } for(uint8 i = 0; i < count; ++i) |