mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Movement/SplineChain: Fix a potential critical bug where resume info returned during an edge case could fail an assertion when used.
This commit is contained in:
@@ -135,7 +135,12 @@ SplineChainResumeInfo SplineChainMovementGenerator::GetResumeInfo(Unit const* me
|
||||
if (!_nextIndex)
|
||||
return SplineChainResumeInfo(_id, &_chain, _walk, 0, 0, _msToNext);
|
||||
if (me->movespline->Finalized())
|
||||
return SplineChainResumeInfo(_id, &_chain, _walk, _nextIndex, 0, 1u);
|
||||
{
|
||||
if (_nextIndex < _chainSize)
|
||||
return SplineChainResumeInfo(_id, &_chain, _walk, _nextIndex, 0, 1u);
|
||||
else
|
||||
return SplineChainResumeInfo();
|
||||
}
|
||||
return SplineChainResumeInfo(_id, &_chain, _walk, uint8(_nextIndex - 1), uint8(me->movespline->_currentSplineIdx()), _msToNext);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user