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->iuser3 = g_iUser3 = src->iuser3;
} }
dst->fuser2 = src->fuser2; dst->fuser2 = src->fuser2;
iOnTrain[src->number] = src->iuser4; if( src->number > 0 && src->number < MAX_PLAYERS )
iOnTrain[src->number] = src->iuser4;
} }
/* /*

View File

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