Core/Entities: Merge duplicate functions calculating relative positions - remove CalculatePassengerPosition/CalculatePassengerOffset from TransportBase class
This commit is contained in:
@@ -618,7 +618,7 @@ void Unit::UpdateSplinePosition()
|
||||
pos.SetOrientation(loc.orientation);
|
||||
|
||||
if (TransportBase* transport = GetDirectTransport())
|
||||
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.orientation);
|
||||
transport->GetPositionWithOffset(pos).GetPosition(loc.x, loc.y, loc.z, loc.orientation);
|
||||
else
|
||||
return;
|
||||
}
|
||||
@@ -12852,10 +12852,7 @@ void Unit::SendTeleportPacket(TeleportLocation const& teleportLocation)
|
||||
if (!transport)
|
||||
return;
|
||||
|
||||
float x, y, z, o;
|
||||
teleportLocation.Location.GetPosition(x, y, z, o);
|
||||
transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
moveUpdateTeleport.Status->pos.Relocate(x, y, z, o);
|
||||
moveUpdateTeleport.Status->pos.Relocate(transport->GetPositionWithOffset(teleportLocation.Location));
|
||||
moveUpdateTeleport.Status->transport.pos.Relocate(teleportLocation.Location);
|
||||
}
|
||||
else
|
||||
@@ -13078,7 +13075,7 @@ void CharmInfo::SaveStayPosition()
|
||||
|
||||
if (_unit->movespline->onTransport)
|
||||
if (TransportBase* transport = _unit->GetDirectTransport())
|
||||
transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
|
||||
transport->GetPositionWithOffset({ stayPos.x, stayPos.y, stayPos.z }).GetPosition(stayPos.x, stayPos.y, stayPos.z);
|
||||
|
||||
_stayX = stayPos.x;
|
||||
_stayY = stayPos.y;
|
||||
|
||||
Reference in New Issue
Block a user