Skip to content

Commit

Permalink
Don't waste 200 ms before droids start moving.
Browse files Browse the repository at this point in the history
The droid no longer spends 100 ms changing psDroid->sMove.Status from MOVEWAITROUTE to
MOVENAVIGATE plus 100 ms changing from MOVENAVIGATE to MOVEPOINTTOPOINT, before starting
to move.

This changes the average response time of trucks to a move order from 450 ms to 250 ms.
  • Loading branch information
Cyp committed Mar 4, 2012
1 parent 9d8e7ce commit f36cb96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/move.cpp
Expand Up @@ -2418,7 +2418,11 @@ void moveUpdateDroid(DROID *psDroid)
case MOVEWAITROUTE:
moveDroidTo(psDroid, psDroid->sMove.destination.x, psDroid->sMove.destination.y);
moveSpeed = MAX(0, psDroid->sMove.speed - 1);
break;
if (psDroid->sMove.Status != MOVENAVIGATE)
{
break;
}
// No break.
case MOVENAVIGATE:
// Get the next control point
if (!moveNextTarget(psDroid))
Expand Down Expand Up @@ -2450,7 +2454,7 @@ void moveUpdateDroid(DROID *psDroid)
bStarted = true;
}

break;
// No break.
case MOVEPOINTTOPOINT:
case MOVEPAUSE:
// moving between two way points
Expand Down

0 comments on commit f36cb96

Please sign in to comment.