aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/NPCHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/NPCHandler.cpp')
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 3505651926b..06fd9155c29 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -122,9 +122,8 @@ void WorldSession::SendTrainerList(Creature* npc, uint32 trainerId)
return;
}
- _player->PlayerTalkClass->GetInteractionData().Reset();
- _player->PlayerTalkClass->GetInteractionData().SourceGuid = npc->GetGUID();
- _player->PlayerTalkClass->GetInteractionData().SetTrainerId(trainerId);
+ _player->PlayerTalkClass->GetInteractionData().StartInteraction(npc->GetGUID(), PlayerInteractionType::Trainer);
+ _player->PlayerTalkClass->GetInteractionData().GetTrainer()->Id = trainerId;
trainer->SendSpells(npc, _player, GetSessionDbLocaleIndex());
}
@@ -143,10 +142,10 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPackets::NPC::TrainerBuySpel
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- if (_player->PlayerTalkClass->GetInteractionData().SourceGuid != packet.TrainerGUID)
+ if (!_player->PlayerTalkClass->GetInteractionData().IsInteractingWith(packet.TrainerGUID, PlayerInteractionType::Trainer))
return;
- if (_player->PlayerTalkClass->GetInteractionData().GetTrainerId() != uint32(packet.TrainerID))
+ if (_player->PlayerTalkClass->GetInteractionData().GetTrainer()->Id != uint32(packet.TrainerID))
return;
Trainer::Trainer const* trainer = sObjectMgr->GetTrainer(packet.TrainerID);
@@ -198,7 +197,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPackets::NPC::GossipSelec
return;
// Prevent cheating on C++ scripted menus
- if (_player->PlayerTalkClass->GetInteractionData().SourceGuid != packet.GossipUnit)
+ if (!_player->PlayerTalkClass->GetInteractionData().IsInteractingWith(packet.GossipUnit, PlayerInteractionType::Gossip))
return;
Creature* unit = nullptr;