mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
A few fixes in ghost and race recorder code
This commit is contained in:
parent
1efa8023ea
commit
491cfdb93e
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue