Fix various crashes

This commit is contained in:
a1batross 2016-02-11 22:29:50 +06:00
parent d083450d70
commit baa405b724
2 changed files with 8 additions and 8 deletions

View File

@ -174,7 +174,8 @@ void DLLEXPORT HUD_ProcessPlayerState( struct entity_state_s *dst, const struct
dst->iuser3 = g_iUser3 = src->iuser3;
}
dst->fuser2 = src->fuser2;
iOnTrain[src->number] = src->iuser4;
if( src->number > 0 && src->number < MAX_PLAYERS )
iOnTrain[src->number] = src->iuser4;
}
/*

View File

@ -456,6 +456,10 @@ int CHudSpectator::Draw(float flTime)
if ( m_vPlayerPos[i][2]<0 ) // marked as invisible ?
continue;
// can player exist without name?
if( !g_PlayerInfoList[i+1].name )
continue;
// check if name would be in inset window
if ( m_pip->value != INSET_OFF )
{
@ -466,7 +470,7 @@ int CHudSpectator::Draw(float flTime)
) continue;
}
color = GetClientColor( i+1 );
color = GetClientColor( i+1 ); // ???
// draw the players name and health underneath
sprintf(string, "%s", g_PlayerInfoList[i+1].name );
@ -1119,16 +1123,11 @@ void CHudSpectator::DrawOverviewLayer()
z *= m_OverviewData.layersHeights[0]; // gOverviewData.z_min - 32;
// i = r_overviewTexture + ( layer*OVERVIEW_X_TILES*OVERVIEW_Y_TILES );
gEngfuncs.pTriAPI->RenderMode( kRenderTransTexture );
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 );
frame = 0;
gEngfuncs.pfnFillRGBA(0, 0, ScreenWidth, ScreenHeight, 0, 0, 0, 0);
// rotated view ?
if ( m_OverviewData.rotated )
{