*Send stop packet iff necessary. Hope this can fix the bug that cannot immediatly remove confuse movement and face wrong direction after charging.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-05-01 21:04:02 -05:00
1 parent c9cd3b07f9
commit a102098eb2
12 files changed
+54 -48

No files matched your search

+2 -2
View File
@@ -113,12 +113,12 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
// currently moving, update location
Traveller<T> traveller(unit);
if( i_destinationHolder.UpdateTraveller(traveller, diff, false))
if( i_destinationHolder.UpdateTraveller(traveller, diff))
{
if( i_destinationHolder.HasArrived())
{
// arrived, stop and wait a bit
unit.StopMoving();
unit.clearUnitState(UNIT_STAT_MOVE);
i_nextMove = urand(1,MAX_CONF_WAYPOINTS);
i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher