aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-07-22 14:32:48 +0200
committerclick <none@none>2010-07-22 14:32:48 +0200
commit31956e06b8180ef2650025f6c68d55f6f42229d6 (patch)
tree13175d09b640cdf017ac571fd781b827814a4e0b
parenta23f4a0f4514f897b2489a61b20aa14f72e11711 (diff)
Add missing CheckStableMaster() functions for SPELL_AURA_OPEN_STABLE-implementation
- casting Call Stabled Pet opens stable-window, with proper updating --HG-- branch : trunk
-rw-r--r--src/server/game/Server/Protocol/Handlers/NPCHandler.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
index 8ec3dca845d..935ccf02f96 100644
--- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
@@ -501,12 +501,8 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
recv_data >> npcGUID;
- Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER);
- if (!unit)
- {
- sLog.outDebug("WORLD: HandleListStabledPetsOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
+ if (!CheckStableMaster(npcGUID))
return;
- }
// remove fake death
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
@@ -591,10 +587,8 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
return;
}
- Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER);
- if (!unit)
+ if (!CheckStableMaster(npcGUID))
{
- sLog.outDebug("WORLD: HandleStablePet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE);
return;
}
@@ -651,10 +645,8 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
recv_data >> npcGUID >> petnumber;
- Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER);
- if (!unit)
+ if (!CheckStableMaster(npcGUID))
{
- sLog.outDebug("WORLD: HandleUnstablePet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE);
return;
}
@@ -722,10 +714,8 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
recv_data >> npcGUID;
- Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER);
- if (!unit)
+ if (!CheckStableMaster(npcGUID))
{
- sLog.outDebug("WORLD: HandleBuyStableSlot - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE);
return;
}
@@ -763,10 +753,8 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
recv_data >> npcGUID >> pet_number;
- Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER);
- if (!unit)
+ if (!CheckStableMaster(npcGUID))
{
- sLog.outDebug("WORLD: HandleStableSwapPet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE);
return;
}