Implement vehicles created by player mounts.

Original idea by Elmaster, packet research by Wrong, ty.

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-01-13 11:16:38 +01:00
parent db24e2927c
commit ea4e25f3aa
11 changed files with 153 additions and 20 deletions

View File

@@ -358,6 +358,20 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
plMover->UpdateFallInformationIfNeed(movementInfo, opcode);
// If on vehicle, update carried players
if (Vehicle *vehicle=plMover->GetVehicleKit())
{
if (plMover->IsVehicle())
{
for (int i=0; i < 8; ++i)
{
if (Unit *passenger = vehicle->GetPassenger(i))
if (passenger != NULL && passenger->GetTypeId() == TYPEID_PLAYER)
((Player*)passenger)->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
}
}
}
if (movementInfo.z < -500.0f)
{
if (plMover->InBattleGround()