aboutsummaryrefslogtreecommitdiff
path: root/src/game/TaxiHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/TaxiHandler.cpp')
-rw-r--r--src/game/TaxiHandler.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/game/TaxiHandler.cpp b/src/game/TaxiHandler.cpp
index 1effa944cda..539f3da8016 100644
--- a/src/game/TaxiHandler.cpp
+++ b/src/game/TaxiHandler.cpp
@@ -31,44 +31,44 @@
#include "WaypointMovementGenerator.h"
#include "DestinationHolderImp.h"
-void WorldSession::HandleTaxiNodeStatusQueryOpcode( WorldPacket & recv_data )
+void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data)
{
- sLog.outDebug( "WORLD: Received CMSG_TAXINODE_STATUS_QUERY" );
+ sLog.outDebug("WORLD: Received CMSG_TAXINODE_STATUS_QUERY");
uint64 guid;
recv_data >> guid;
- SendTaxiStatus( guid );
+ SendTaxiStatus(guid);
}
-void WorldSession::SendTaxiStatus( uint64 guid )
+void WorldSession::SendTaxiStatus(uint64 guid)
{
// cheating checks
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
{
- sLog.outDebug( "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid)) );
+ sLog.outDebug("WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid)));
return;
}
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam());
// not found nearest
if (curloc == 0)
return;
- sLog.outDebug( "WORLD: current location %u ",curloc);
+ sLog.outDebug("WORLD: current location %u ",curloc);
- WorldPacket data( SMSG_TAXINODE_STATUS, 9 );
+ WorldPacket data(SMSG_TAXINODE_STATUS, 9);
data << guid;
- data << uint8( GetPlayer( )->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0 );
- SendPacket( &data );
- sLog.outDebug( "WORLD: Sent SMSG_TAXINODE_STATUS" );
+ data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0);
+ SendPacket(&data);
+ sLog.outDebug("WORLD: Sent SMSG_TAXINODE_STATUS");
}
-void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
+void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
{
- sLog.outDebug( "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES" );
+ sLog.outDebug("WORLD: Received CMSG_TAXIQUERYAVAILABLENODES");
uint64 guid;
recv_data >> guid;
@@ -77,7 +77,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!unit)
{
- sLog.outDebug( "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
+ sLog.outDebug("WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
return;
}
@@ -86,39 +86,39 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// unknown taxi node case
- if ( SendLearnNewTaxiNode(unit) )
+ if (SendLearnNewTaxiNode(unit))
return;
// known taxi node case
- SendTaxiMenu( unit );
+ SendTaxiMenu(unit);
}
-void WorldSession::SendTaxiMenu( Creature* unit )
+void WorldSession::SendTaxiMenu(Creature* unit)
{
// find current node
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam());
- if ( curloc == 0 )
+ if (curloc == 0)
return;
bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater();
if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
- sLog.outDebug( "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc);
+ sLog.outDebug("WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc);
- WorldPacket data( SMSG_SHOWTAXINODES, (4+8+4+8*4) );
- data << uint32( 1 );
- data << uint64( unit->GetGUID() );
- data << uint32( curloc );
+ WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4));
+ data << uint32(1);
+ data << uint64(unit->GetGUID());
+ data << uint32(curloc);
GetPlayer()->m_taxi.AppendTaximaskTo(data,GetPlayer()->isTaxiCheater());
- SendPacket( &data );
+ SendPacket(&data);
- sLog.outDebug( "WORLD: Sent SMSG_SHOWTAXINODES" );
+ sLog.outDebug("WORLD: Sent SMSG_SHOWTAXINODES");
GetPlayer()->SetTaxiCheater(lastTaxiCheaterState);
}
-void WorldSession::SendDoFlight( uint32 mountDisplayId, uint32 path, uint32 pathNode )
+void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode)
{
// remove fake death
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
@@ -128,28 +128,28 @@ void WorldSession::SendDoFlight( uint32 mountDisplayId, uint32 path, uint32 path
GetPlayer()->GetMotionMaster()->MovementExpired(false);
if (mountDisplayId)
- GetPlayer()->Mount( mountDisplayId );
+ GetPlayer()->Mount(mountDisplayId);
GetPlayer()->GetMotionMaster()->MoveTaxiFlight(path,pathNode);
}
-bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
+bool WorldSession::SendLearnNewTaxiNode(Creature* unit)
{
// find current node
- uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer( )->GetTeam());
+ uint32 curloc = objmgr.GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam());
- if ( curloc == 0 )
+ if (curloc == 0)
return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result.
- if ( GetPlayer()->m_taxi.SetTaximaskNode(curloc) )
+ if (GetPlayer()->m_taxi.SetTaximaskNode(curloc))
{
WorldPacket msg(SMSG_NEW_TAXI_PATH, 0);
- SendPacket( &msg );
+ SendPacket(&msg);
- WorldPacket update( SMSG_TAXINODE_STATUS, 9 );
- update << uint64( unit->GetGUID() );
- update << uint8( 1 );
- SendPacket( &update );
+ WorldPacket update(SMSG_TAXINODE_STATUS, 9);
+ update << uint64(unit->GetGUID());
+ update << uint8(1);
+ SendPacket(&update);
return true;
}
@@ -157,9 +157,9 @@ bool WorldSession::SendLearnNewTaxiNode( Creature* unit )
return false;
}
-void WorldSession::HandleActivateTaxiExpressOpcode ( WorldPacket & recv_data )
+void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data)
{
- sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXIEXPRESS" );
+ sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS");
uint64 guid;
uint32 node_count;
@@ -169,7 +169,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode ( WorldPacket & recv_data )
Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc)
{
- sLog.outDebug( "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)) );
+ sLog.outDebug("WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)));
return;
}
std::vector<uint32> nodes;
@@ -184,14 +184,14 @@ void WorldSession::HandleActivateTaxiExpressOpcode ( WorldPacket & recv_data )
if (nodes.empty())
return;
- sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back());
+ sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back());
GetPlayer()->ActivateTaxiPathTo(nodes, npc);
}
void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
{
- sLog.outDebug( "WORLD: Received CMSG_MOVE_SPLINE_DONE" );
+ sLog.outDebug("WORLD: Received CMSG_MOVE_SPLINE_DONE");
uint64 guid; // used only for proper packet read
if (!recv_data.readPackGUID(guid))
@@ -231,7 +231,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
}
uint32 destinationnode = GetPlayer()->m_taxi.NextTaxiDestination();
- if ( destinationnode > 0 ) // if more destinations to go
+ if (destinationnode > 0) // if more destinations to go
{
// current source node for next destination
uint32 sourcenode = GetPlayer()->m_taxi.GetTaxiSource();
@@ -242,19 +242,19 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
if (GetPlayer()->m_taxi.SetTaximaskNode(sourcenode))
{
WorldPacket data(SMSG_NEW_TAXI_PATH, 0);
- _player->GetSession()->SendPacket( &data );
+ _player->GetSession()->SendPacket(&data);
}
}
- sLog.outDebug( "WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode );
+ sLog.outDebug("WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode);
uint32 mountDisplayId = objmgr.GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam());
uint32 path, cost;
- objmgr.GetTaxiPath( sourcenode, destinationnode, path, cost);
+ objmgr.GetTaxiPath(sourcenode, destinationnode, path, cost);
if (path && mountDisplayId)
- SendDoFlight( mountDisplayId, path, 1 ); // skip start fly node
+ SendDoFlight(mountDisplayId, path, 1); // skip start fly node
else
GetPlayer()->m_taxi.ClearTaxiDestinations(); // clear problematic path and next
return;
@@ -266,20 +266,20 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
}
-void WorldSession::HandleActivateTaxiOpcode( WorldPacket & recv_data )
+void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data)
{
- sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXI" );
+ sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXI");
uint64 guid;
std::vector<uint32> nodes;
nodes.resize(2);
recv_data >> guid >> nodes[0] >> nodes[1];
- sLog.outDebug( "WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]);
+ sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]);
Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc)
{
- sLog.outDebug( "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)) );
+ sLog.outDebug("WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid)));
return;
}