mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Hopefully fix rare crash on dummy switch
This commit is contained in:
parent
3d802dd5aa
commit
417e4110ed
|
@ -250,15 +250,18 @@ void CHud::RenderScoreHud()
|
|||
{
|
||||
// draw name
|
||||
int ID = apPlayerInfo[t]->m_ClientID;
|
||||
const char *pName = m_pClient->m_aClients[ID].m_aName;
|
||||
float w = TextRender()->TextWidth(0, 8.0f, pName, -1);
|
||||
TextRender()->Text(0, min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split-PosSize), StartY+(t+1)*20.0f-3.0f, 8.0f, pName, -1);
|
||||
if(ID >= 0 && ID < MAX_CLIENTS)
|
||||
{
|
||||
const char *pName = m_pClient->m_aClients[ID].m_aName;
|
||||
float w = TextRender()->TextWidth(0, 8.0f, pName, -1);
|
||||
TextRender()->Text(0, min(Whole-w-1.0f, Whole-ScoreWidthMax-ImageSize-2*Split-PosSize), StartY+(t+1)*20.0f-3.0f, 8.0f, pName, -1);
|
||||
|
||||
// draw tee
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[ID].m_RenderInfo;
|
||||
Info.m_Size = 18.0f;
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0),
|
||||
vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, StartY+1.0f+Info.m_Size/2+t*20));
|
||||
// draw tee
|
||||
CTeeRenderInfo Info = m_pClient->m_aClients[ID].m_RenderInfo;
|
||||
Info.m_Size = 18.0f;
|
||||
RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, EMOTE_NORMAL, vec2(1,0),
|
||||
vec2(Whole-ScoreWidthMax-Info.m_Size/2-Split, StartY+1.0f+Info.m_Size/2+t*20));
|
||||
}
|
||||
}
|
||||
|
||||
// draw position
|
||||
|
|
Loading…
Reference in a new issue