Cleanup team manager

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

Former-commit-id: eb6e63c6416ba6ec1e29fb190f244093d787c4ed
Former-commit-id: e54d010e622063298393d27e588de84202ad520a
This commit is contained in:
wdbee 2009-03-05 20:24:27 +00:00
parent 6fbc4f8033
commit d47857c95c
5 changed files with 7 additions and 20 deletions

View file

@ -930,9 +930,6 @@ void TDriver::NewRace(PtCarElt Car, PSituation Situation)
//--------------------------------------------------------------------------*
void TDriver::Drive()
{
#ifdef TORCS_NG
RtTeamManagerStart();
#endif
/*
if (CarLaps == 1 + oIndex)
oTestPitStop = 1;

View file

@ -428,10 +428,7 @@ void Driver::newRace(tCarElt* car, tSituation *s)
}
}
#ifdef TORCS_NG
RtTeamManagerShowInfo();
teamIndex = RtTeamManagerIndex(car,track,s);
RtTeamManagerDump();
strategy->setTeamIndex(teamIndex);
#endif
}
@ -602,10 +599,6 @@ void Driver::drive(tSituation *s)
laststeer = car->_steerCmd;
memset(&car->ctrl, 0, sizeof(tCarCtrl));
#ifdef TORCS_NG
RtTeamManagerStart(); // Start team manager in case not all robots are using it
#endif
update(s);
//pit->setPitstop(true);
@ -701,7 +694,6 @@ void Driver::endRace(tSituation *s)
void Driver::shutdown()
{
#ifdef TORCS_NG
RtTeamManagerDump();
RtTeamManagerRelease();
#endif
// Nothing for now.

View file

@ -44,6 +44,8 @@
#include "racegl.h"
#include "raceresults.h"
#include "teammanager.h"
#include "raceinit.h"
static const char *level_str[] = { ROB_VAL_ROOKIE, ROB_VAL_AMATEUR, ROB_VAL_SEMI_PRO, ROB_VAL_PRO };
@ -786,6 +788,7 @@ ReRaceCleanDrivers(void)
GfParmReleaseHandle(ReInfo->s->cars[i]->_paramsHandle);
free(robot);
}
RtTeamManagerRelease();
FREEZ(ReInfo->s->cars);
ReInfo->s->cars = 0;

View file

@ -38,6 +38,8 @@
#include "racestate.h"
#include "racemanmenu.h"
#include "teammanager.h"
#include "racemain.h"
static char buf[1024];
@ -220,6 +222,7 @@ reRaceRealStart(void)
robot->rbNewRace(robot->index, s->cars[i], s);
}
carInfo = ReInfo->_reCarInfo;
RtTeamManagerStart();
ReInfo->_reSimItf.update(s, RCM_MAX_DT_SIMU, -1);
for (i = 0; i < s->_ncars; i++) {

View file

@ -486,15 +486,7 @@ int RtTeamManagerIndex(CarElt* const Car, tTrack* const Track, tSituation* Situa
tTeamPit* TeamPit = NULL;
tTeam* Team = RtTeamManagerAdd(Car,Teammate,&TeamPit);
int TeamIndex = RtTeamDriverAdd(Team, Teammate, TeamPit);
tTeamDriver* TeamDriver = RtTM->TeamDrivers;
if (TeamDriver->Count < RtTM->Count)
return TeamIndex;
RtTeamManagerSetup();
return TeamIndex;
return RtTeamDriverAdd(Team, Teammate, TeamPit);
}
//