Add missing CheckStableMaster() functions for SPELL_AURA_OPEN_STABLE-implementation

- casting Call Stabled Pet opens stable-window, with proper updating

--HG--
branch : trunk
This commit is contained in:
click
2010-07-22 14:32:48 +02:00
parent a23f4a0f45
commit 31956e06b8
@@ -501,12 +501,8 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data)
recv_data >> npcGUID; recv_data >> npcGUID;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER); if (!CheckStableMaster(npcGUID))
if (!unit)
{
sLog.outDebug("WORLD: HandleListStabledPetsOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
return; return;
}
// remove fake death // remove fake death
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
@@ -591,10 +587,8 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data)
return; return;
} }
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER); if (!CheckStableMaster(npcGUID))
if (!unit)
{ {
sLog.outDebug("WORLD: HandleStablePet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
return; return;
} }
@@ -651,10 +645,8 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
recv_data >> npcGUID >> petnumber; recv_data >> npcGUID >> petnumber;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER); if (!CheckStableMaster(npcGUID))
if (!unit)
{ {
sLog.outDebug("WORLD: HandleUnstablePet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
return; return;
} }
@@ -722,10 +714,8 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
recv_data >> npcGUID; recv_data >> npcGUID;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER); if (!CheckStableMaster(npcGUID))
if (!unit)
{ {
sLog.outDebug("WORLD: HandleBuyStableSlot - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
return; return;
} }
@@ -763,10 +753,8 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
recv_data >> npcGUID >> pet_number; recv_data >> npcGUID >> pet_number;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_STABLEMASTER); if (!CheckStableMaster(npcGUID))
if (!unit)
{ {
sLog.outDebug("WORLD: HandleStableSwapPet - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
return; return;
} }