aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/TaxiHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/TaxiHandler.cpp')
-rw-r--r--src/server/game/Handlers/TaxiHandler.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp
index d878a406909..e72dda130c3 100644
--- a/src/server/game/Handlers/TaxiHandler.cpp
+++ b/src/server/game/Handlers/TaxiHandler.cpp
@@ -16,15 +16,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "WorldSession.h"
#include "Common.h"
#include "ConditionMgr.h"
#include "Containers.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "Opcodes.h"
#include "Log.h"
+#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "TaxiPackets.h"
@@ -33,11 +32,10 @@
void WorldSession::HandleEnableTaxiNodeOpcode(WorldPackets::Taxi::EnableTaxiNode& enableTaxiNode)
{
- Creature* unit = GetPlayer()->GetMap()->GetCreature(enableTaxiNode.Unit);
- SendLearnNewTaxiNode(unit);
+ if (Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(enableTaxiNode.Unit, UNIT_NPC_FLAG_FLIGHTMASTER))
+ SendLearnNewTaxiNode(unit);
}
-
void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPackets::Taxi::TaxiNodeStatusQuery& taxiNodeStatusQuery)
{
SendTaxiStatus(taxiNodeStatusQuery.UnitGUID);
@@ -46,7 +44,7 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPackets::Taxi::TaxiNodeS
void WorldSession::SendTaxiStatus(ObjectGuid guid)
{
// cheating checks
- Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
+ Creature* unit = ObjectAccessor::GetCreature(*GetPlayer(), guid);
if (!unit)
{
TC_LOG_DEBUG("network", "WorldSession::SendTaxiStatus - %s not found.", guid.ToString().c_str());