aboutsummaryrefslogtreecommitdiff
path: root/src/game/WorldSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/WorldSession.cpp')
-rw-r--r--src/game/WorldSession.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp
index 569c8fade62..61badc7ef28 100644
--- a/src/game/WorldSession.cpp
+++ b/src/game/WorldSession.cpp
@@ -30,6 +30,7 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Player.h"
+#include "Vehicle.h"
#include "ObjectMgr.h"
#include "Group.h"
#include "Guild.h"
@@ -937,6 +938,39 @@ void WorldSession::SendAddonsInfo()
SendPacket(&data);
}
+
+void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data)
+{
+ // Read guid
+ uint64 guid;
+ data >> guid;
+
+ if(Player* pl=ObjectAccessor::FindPlayer(guid))
+ {
+ if (!pl->GetVehicleKit())
+ return;
+ if (!pl->IsInRaidWith(_player))
+ return;
+ if(!pl->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
+ return;
+ _player->EnterVehicle(pl);
+ }
+}
+
+void WorldSession::HandleEjectPasenger(WorldPacket &data)
+{
+ if(data.GetOpcode()==CMSG_EJECT_PASSENGER)
+ {
+ if(Vehicle* Vv= _player->GetVehicleKit())
+ {
+ uint64 guid;
+ data >> guid;
+ if(Player* Pl=ObjectAccessor::FindPlayer(guid))
+ Pl->ExitVehicle();
+ }
+ }
+ }
+
void WorldSession::SetPlayer( Player *plr )
{
_player = plr;