Core/Movement: PropagateSpeedChange should only be called on the top (current active) movement generator

This commit is contained in:
ccrs
2017-08-08 19:49:12 +02:00
parent ee2d7c1d53
commit 40903dcd65

View File

@@ -180,11 +180,14 @@ MovementGenerator* MotionMaster::GetMotionSlot(int slot) const
void MotionMaster::PropagateSpeedChange()
{
for (int i = 0; i <= _top; ++i)
{
if (_slot[i])
_slot[i]->UnitSpeedChanged();
}
if (empty())
return;
MovementGenerator* movement = top();
if (!movement)
return;
movement->UnitSpeedChanged();
}
bool MotionMaster::GetDestination(float &x, float &y, float &z)