From 41b0b88674c84ba91d2d2cfdf63e363452de6a34 Mon Sep 17 00:00:00 2001 From: Arthorius Date: Wed, 16 Dec 2009 23:13:03 +0300 Subject: [PATCH] [9009] More fixes in pet action bar buttons swap. Signed-off-by: VladimirMangos --- src/game/PetHandler.cpp | 28 +++++++++++++++++----------- src/shared/revision_nr.h | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index a58f7e5bf..8dc158f3d 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -352,22 +352,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) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0eb20d595..f9a41d104 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 "9008" + #define REVISION_NR "9009" #endif // __REVISION_NR_H__