fixed race time problem that causes network play to work incorrectly

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

Former-commit-id: 410197fc82386ecac5b9d6e3af954741271f193c
Former-commit-id: 4a07d1ee4f1490063fa2a3f7234f29a4fb5a42b7
This commit is contained in:
briangr 2010-07-10 17:50:44 +00:00
parent 366a5eb78f
commit c8e0787392
2 changed files with 9 additions and 1 deletions

View file

@ -1019,7 +1019,8 @@ ReOneStep(double deltaTimeIncrement)
if (s->currentTime < -2.0)
{
sprintf(buf,"Race will start in %i seconds", -s->currentTime);
int t = -s->currentTime;
sprintf(buf,"Race will start in %i seconds", t);
ReRaceBigMsgSet(buf, 1.0);
}
}

View file

@ -124,6 +124,9 @@ ReStateManage(void)
mode = ReRaceStart();
if (GetNetwork())
{
float f = GfTimeClock();
float rs = GetNetwork()->GetRaceStartTime();
ReInfo->s->currentTime = GfTimeClock() - GetNetwork()->GetRaceStartTime();
GetNetwork()->RaceInit(ReInfo->s);
GetNetwork()->SetRaceActive(true);
}
@ -136,7 +139,11 @@ ReStateManage(void)
case RE_STATE_NETWORK_WAIT:
if (!WaitForNetwork())
{
ReInfo->_reState = RE_STATE_RACE;
ReSetRaceBigMsg("");
break;
}
if (GetNetwork())
{