From 029ea6ee9e0f5ab6c74333506d28e8ca831e1bad Mon Sep 17 00:00:00 2001 From: GreYFoXGTi Date: Thu, 26 Aug 2010 20:28:41 +0200 Subject: [PATCH] made a checkpoint accessible only once during a race Signed-off-by: GreYFoXGTi --- src/game/server/entities/character.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 562c96722..7d1210c27 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -65,7 +65,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos) m_ActiveWeapon = WEAPON_GUN; m_LastWeapon = WEAPON_HAMMER; m_QueuedWeapon = -1; - + m_CpActive = -2; m_pPlayer = pPlayer; m_Pos = Pos; m_OlderPos = Pos; @@ -657,7 +657,7 @@ void CCharacter::Tick() 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_CpCurrent[cp] = time; @@ -673,6 +673,7 @@ void CCharacter::Tick() if(((TileIndex1 == TILE_END) || (TileIndex2 == TILE_END)) && m_RaceState == RACE_STARTED) { 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)); if(!g_Config.m_SvHideScore) GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf);