Core/Vehicles: Fixed channeled spells being interrupted for passengers when vehicle moves

This commit is contained in:
Shauren committed 2014-06-09 21:08:19 +02:00
1 parent e5bd194bf8
commit f81635ebe5
2 files changed
+17 -4

No files matched your search

+14 -3
View File
@@ -30,6 +30,7 @@
#include "WaypointMovementGenerator.h"
#include "InstanceSaveMgr.h"
#include "ObjectMgr.h"
#include "Vehicle.h"
#define MOVEMENT_PACKET_TIME_DELAY 0
@@ -370,10 +371,20 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
mover->m_movementInfo = movementInfo;
// this is almost never true (not sure why it is sometimes, but it is), normally use mover->IsVehicle()
if (mover->GetVehicle())
// Some vehicles allow the passenger to turn by himself
if (Vehicle* vehicle = mover->GetVehicle())
{
mover->SetOrientation(movementInfo.pos.GetOrientation());
if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(mover))
{
if (seat->m_flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)
{
if (movementInfo.pos.GetOrientation() != mover->GetOrientation())
{
mover->SetOrientation(movementInfo.pos.GetOrientation());
mover->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
}
}
}
return;
}