Add accelerations in unit movement.

This helps preventing arrow dodging.

Differential Revision: D3200
Reviewed By: Freagarach
Comments By: wraitii, vladislav, Palaxin, Stan
refs: #5106

This was SVN commit r25953.
This commit is contained in:
bb
2021-10-09 21:31:11 +00:00
parent 4640a1fd36
commit acc780bcbb
79 changed files with 226 additions and 43 deletions
@@ -167,6 +167,7 @@ void CCmpUnitMotionManager::Move(EntityMap<MotionState>& ents, fixed dt)
it->second.initialPos = it->second.cmpPosition->GetPosition2D();
it->second.initialAngle = it->second.cmpPosition->GetRotation().Y;
it->second.pos = it->second.initialPos;
it->second.speed = it->second.cmpUnitMotion->GetCurrentSpeed();
it->second.angle = it->second.initialAngle;
ENSURE(it->second.pos.X.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.width() &&
it->second.pos.Y.ToInt_RoundToZero() / PUSHING_GRID_SIZE < m_MovingUnits.height());