diff options
author | thenecromancer <none@none> | 2010-01-13 11:16:38 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-01-13 11:16:38 +0100 |
commit | ea4e25f3aaa10efeacf0849bcb1583ad78ee2b28 (patch) | |
tree | 9873402e58eb955e2db047f0c31b2760df32d019 /src/game/WorldSession.cpp | |
parent | db24e2927c0a67576011692ef8c2f8150da9425f (diff) |
Implement vehicles created by player mounts.
Original idea by Elmaster, packet research by Wrong, ty.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WorldSession.cpp')
-rw-r--r-- | src/game/WorldSession.cpp | 34 |
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; |