mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Vehicles: Fixed channeled spells being interrupted for passengers when vehicle moves
This commit is contained in:
@@ -17079,12 +17079,14 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
|
||||
bool turn = (GetOrientation() != orientation);
|
||||
bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z);
|
||||
|
||||
// TODO: Check if orientation transport offset changed instead of only global orientation
|
||||
if (turn)
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TURNING);
|
||||
|
||||
if (relocated)
|
||||
{
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
|
||||
if (!GetVehicle())
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOVE);
|
||||
|
||||
// move and update visible state if need
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user