Implement vehicles created by player mounts.
Original idea by Elmaster, packet research by Wrong, ty. --HG-- branch : trunk
This commit is contained in:
1 parent
db24e2927c
commit
ea4e25f3aa
11 files changed
+153
-20
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user