From b834426548107af96c2568af22cbf8604f230965 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 12 Mar 2011 18:07:57 +0100 Subject: fixed several problems with spectator view in game and demo player. Closes #83 --- src/game/client/components/scoreboard.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/game/client/components/scoreboard.cpp') diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index a9b249ed..0d355456 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -151,11 +151,14 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch } else { - char aBuf[128]; - int Score = m_pClient->m_Snap.m_pLocalInfo->m_Score; - str_format(aBuf, sizeof(aBuf), "%d", Score); - tw = TextRender()->TextWidth(0, 48, aBuf, -1); - TextRender()->Text(0, x+w-tw-30, y, 48, aBuf, -1); + if(m_pClient->m_Snap.m_pLocalInfo) + { + char aBuf[128]; + int Score = m_pClient->m_Snap.m_pLocalInfo->m_Score; + str_format(aBuf, sizeof(aBuf), "%d", Score); + tw = TextRender()->TextWidth(0, 48, aBuf, -1); + TextRender()->Text(0, x+w-tw-30, y, 48, aBuf, -1); + } } y += 54.0f; -- cgit 1.4.1