1
0
forked from 0ad/0ad

Fix OOS in unit motion

Fixes 592453c62f
wasObstructed and wentStraight are not reset when Move() isn't called,
but PostMove may still be called (if the unit was pushed). This will
OOS.

Differential Revision: https://code.wildfiregames.com/D4088
This was SVN commit r25686.
This commit is contained in:
wraitii 2021-06-05 09:33:57 +00:00
parent 7de9487a87
commit 3745940de8

View File

@ -965,6 +965,9 @@ void CCmpUnitMotion::PreMove(CCmpUnitMotionManager::MotionState& state)
{
state.ignore = !m_Pushing || !m_BlockMovement;
state.wasObstructed = false;
state.wentStraight = false;
// If we were idle and will still be, no need for an update.
state.needUpdate = state.cmpPosition->IsInWorld() &&
(m_CurSpeed != fixed::Zero() || m_MoveRequest.m_Type != MoveRequest::NONE);