From 491cfdb93e86da32945cb997db821e23c2c4f284 Mon Sep 17 00:00:00 2001 From: Redix Date: Fri, 15 Sep 2017 01:55:29 +0200 Subject: [PATCH] A few fixes in ghost and race recorder code --- src/game/client/components/ghost.cpp | 3 ++- src/game/client/components/players.cpp | 4 ++-- src/game/client/components/race_demo.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/ghost.cpp b/src/game/client/components/ghost.cpp index c3587f2f1..03497a49d 100644 --- a/src/game/client/components/ghost.cpp +++ b/src/game/client/components/ghost.cpp @@ -12,7 +12,7 @@ #include "menus.h" #include "ghost.h" -CGhost::CGhost() : m_StartRenderTick(-1), m_LastDeathTick(-1), m_Rendering(false), m_Recording(false) {} +CGhost::CGhost() : m_StartRenderTick(-1), m_LastDeathTick(-1), m_Recording(false), m_Rendering(false) {} void CGhost::GetGhostSkin(CGhostSkin *pSkin, const char *pSkinName, int UseCustomColor, int ColorBody, int ColorFeet) { @@ -280,6 +280,7 @@ void CGhost::StartRecord(int Tick) m_Recording = true; m_CurGhost.Reset(); m_CurGhost.m_StartTick = Tick; + m_CurGhost.m_lPath.hint_size(25*60); const CGameClient::CClientData *pData = &m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID]; str_copy(m_CurGhost.m_aPlayer, g_Config.m_PlayerName, sizeof(m_CurGhost.m_aPlayer)); diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index a6db5ee32..61f92cc6c 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -249,7 +249,7 @@ void CPlayers::RenderHook( bool OtherTeam; - if (m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW || ClientID < 0) + if ((m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) || ClientID < 0) OtherTeam = false; else if (m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) OtherTeam = m_pClient->m_Teams.Team(ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID); @@ -408,7 +408,7 @@ void CPlayers::RenderPlayer( bool OtherTeam; - if (m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW || ClientID < 0) + if ((m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_Team == TEAM_SPECTATORS && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) || ClientID < 0) OtherTeam = false; else if (m_pClient->m_Snap.m_SpecInfo.m_Active && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) OtherTeam = m_pClient->m_Teams.Team(ClientID) != m_pClient->m_Teams.Team(m_pClient->m_Snap.m_SpecInfo.m_SpectatorID); diff --git a/src/game/client/components/race_demo.cpp b/src/game/client/components/race_demo.cpp index 56638b06b..146cc965d 100644 --- a/src/game/client/components/race_demo.cpp +++ b/src/game/client/components/race_demo.cpp @@ -35,7 +35,7 @@ void CRaceDemo::OnRender() vec2 PrevPos = vec2(m_pClient->m_Snap.m_pLocalPrevCharacter->m_X, m_pClient->m_Snap.m_pLocalPrevCharacter->m_Y); vec2 Pos = vec2(m_pClient->m_Snap.m_pLocalCharacter->m_X, m_pClient->m_Snap.m_pLocalCharacter->m_Y); - if(CRaceHelper::IsStart(m_pClient, m_pClient->m_PredictedPrevChar.m_Pos, m_pClient->m_LocalCharacterPos)) + if(CRaceHelper::IsStart(m_pClient, PrevPos, Pos)) { if(m_RaceState == RACE_STARTED) Client()->RaceRecord_Stop();