Update NPCHandler.cpp
This commit is contained in:
parent
5de2bb0a11
commit
874a124588
@ -94,8 +94,8 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle,
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: SendTrainerList");
|
||||
|
||||
Creature* unit = trainerEntry ? GetPlayer()->GetMap()->GetCreature(guid) : GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||
if (!unit)
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||
if (!unit && !trainerEntry)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: SendTrainerList - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
||||
return;
|
||||
@ -217,8 +217,8 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
||||
|
||||
recvData >> guid >> spellId;
|
||||
|
||||
Creature* unit = GetCurrentTrainer() ? GetPlayer()->GetMap()->GetCreature(guid) : GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||
if (!unit)
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||
if (!unit && !GetCurrentTrainer())
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: HandleTrainerBuySpellOpcode - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user