mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 04:42:10 +01:00
Core/Transports: Added extra transport position update just when it stops moving
Closes #17952
This commit is contained in:
@@ -127,6 +127,7 @@ void Transport::Update(uint32 diff)
|
||||
m_goValue.Transport.PathProgress += diff;
|
||||
|
||||
uint32 timer = m_goValue.Transport.PathProgress % GetTransportPeriod();
|
||||
bool justStopped = false;
|
||||
|
||||
// Set current waypoint
|
||||
// Desired outcome: _currentFrame->DepartureTime < timer < _nextFrame->ArriveTime
|
||||
@@ -145,6 +146,7 @@ void Transport::Update(uint32 diff)
|
||||
if (timer < _currentFrame->DepartureTime)
|
||||
{
|
||||
SetMoving(false);
|
||||
justStopped = true;
|
||||
if (_pendingStop && GetGoState() != GO_STATE_READY)
|
||||
{
|
||||
SetGoState(GO_STATE_READY);
|
||||
@@ -197,7 +199,7 @@ void Transport::Update(uint32 diff)
|
||||
if (_positionChangeTimer.Passed())
|
||||
{
|
||||
_positionChangeTimer.Reset(positionUpdateDelay);
|
||||
if (IsMoving())
|
||||
if (IsMoving() || justStopped)
|
||||
{
|
||||
float t = CalculateSegmentPos(float(timer) * 0.001f);
|
||||
G3D::Vector3 pos, dir;
|
||||
|
||||
Reference in New Issue
Block a user