diff options
author | megamage <none@none> | 2009-08-30 11:50:55 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-30 11:50:55 -0500 |
commit | 31324d56ebd3e6a2f089ec896bc87e23bbae3260 (patch) | |
tree | 2e17b1316765ea5cb29bb7e0216ea3bdf9c2974c /src/game/IdleMovementGenerator.cpp | |
parent | c5fe21046198613f1fc85a6fbc918b7c4a002866 (diff) |
*Fix the lurker below. Thanks to rat.
--HG--
branch : trunk
Diffstat (limited to 'src/game/IdleMovementGenerator.cpp')
-rw-r--r-- | src/game/IdleMovementGenerator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/IdleMovementGenerator.cpp b/src/game/IdleMovementGenerator.cpp index 1809d8cd0ca..7c68e3c09f5 100644 --- a/src/game/IdleMovementGenerator.cpp +++ b/src/game/IdleMovementGenerator.cpp @@ -57,14 +57,14 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff) float angle = owner.GetOrientation(); if(m_direction == ROTATE_DIRECTION_LEFT) { - angle += diff / m_duration * M_PI * 2; - if(angle >= M_PI * 2 ) angle = 0; + angle += (float)diff * M_PI * 2 / m_maxDuration; + while(angle >= M_PI * 2 ) angle -= M_PI * 2; } else { - angle -= diff / m_duration * M_PI * 2; - if(angle < 0) angle = M_PI * 2; - } + angle -= (float)diff * M_PI * 2 / m_maxDuration; + while(angle < 0) angle += M_PI * 2; + } owner.SetOrientation(angle); owner.SendMovementFlagUpdate(); // this is a hack. we do not have anything correct to send in the beginning |