made a checkpoint accessible only once during a race

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
GreYFoXGTi 2010-08-26 20:28:41 +02:00
parent c5a8160e4d
commit 029ea6ee9e

View file

@ -65,7 +65,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
m_ActiveWeapon = WEAPON_GUN; m_ActiveWeapon = WEAPON_GUN;
m_LastWeapon = WEAPON_HAMMER; m_LastWeapon = WEAPON_HAMMER;
m_QueuedWeapon = -1; m_QueuedWeapon = -1;
m_CpActive = -2;
m_pPlayer = pPlayer; m_pPlayer = pPlayer;
m_Pos = Pos; m_Pos = Pos;
m_OlderPos = Pos; m_OlderPos = Pos;
@ -657,7 +657,7 @@ void CCharacter::Tick()
int cp = GameServer()->Collision()->IsCheckpoint(MapIndex); int cp = GameServer()->Collision()->IsCheckpoint(MapIndex);
if(cp != -1 && m_RaceState == RACE_STARTED) if(cp != -1 && m_RaceState == RACE_STARTED && cp > m_CpActive)
{ {
m_CpActive = cp; m_CpActive = cp;
m_CpCurrent[cp] = time; m_CpCurrent[cp] = time;
@ -673,6 +673,7 @@ void CCharacter::Tick()
if(((TileIndex1 == TILE_END) || (TileIndex2 == TILE_END)) && m_RaceState == RACE_STARTED) if(((TileIndex1 == TILE_END) || (TileIndex2 == TILE_END)) && m_RaceState == RACE_STARTED)
{ {
char aBuf[128]; char aBuf[128];
m_CpActive=-2;
str_format(aBuf, sizeof(aBuf), "%s finished in: %d minute(s) %5.2f second(s)", Server()->ClientName(m_pPlayer->GetCID()), (int)time/60, time-((int)time/60*60)); str_format(aBuf, sizeof(aBuf), "%s finished in: %d minute(s) %5.2f second(s)", Server()->ClientName(m_pPlayer->GetCID()), (int)time/60, time-((int)time/60*60));
if(!g_Config.m_SvHideScore) if(!g_Config.m_SvHideScore)
GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf); GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf);