Call endrace when a car is out of the race

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@799 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 13bf80e76938776b38dbc15a211e5499aa290431
Former-commit-id: 78d973287a28d04701aafd874951a506170e28f2
This commit is contained in:
martkelder 2009-03-02 07:38:29 +00:00
parent efdf834848
commit 5a159e03c6
2 changed files with 7 additions and 0 deletions

View file

@ -212,6 +212,7 @@ typedef struct {
#define RM_CAR_STATE_BROKEN 0x00000200 /**< Engine no more working */
#define RM_CAR_STATE_OUTOFGAS 0x00000400 /**< Out of Gas */
#define RM_CAR_STATE_ELIMINATED 0x00000800 /**< Eliminated due to rules infringement */
#define RM_CAR_STATE_ENDRACE_CALLED 0x00001000 /**< Endrace called so robot freed a part of its data */
#define RM_CAR_STATE_SIMU_NO_MOVE 0x00010000 /**< Simulation without car move (i.e. clutch applied and no wheel move) */
tPosd corner[4];

View file

@ -548,6 +548,12 @@ ReOneStep(double deltaTimeIncrement)
robot = s->cars[i]->robot;
robot->rbDrive(robot->index, s->cars[i], s);
}
else if (! (s->cars[i]->_state & RM_CAR_STATE_ENDRACE_CALLED ) && s->cars[i]->_state & RM_CAR_STATE_OUT ) { //No simu, look if it is out
robot = s->cars[i]->robot;
if (robot->rbEndRace)
robot->rbEndRace(robot->index, s->cars[i], s);
s->cars[i]->_state |= RM_CAR_STATE_ENDRACE_CALLED;
}
}
ReInfo->_reLastTime = s->currentTime;
}