diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/vgui_netgraphpanel.cpp | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/game/client/vgui_netgraphpanel.cpp')
| -rw-r--r-- | mp/src/game/client/vgui_netgraphpanel.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mp/src/game/client/vgui_netgraphpanel.cpp b/mp/src/game/client/vgui_netgraphpanel.cpp index 0f601438..adf3e4b9 100644 --- a/mp/src/game/client/vgui_netgraphpanel.cpp +++ b/mp/src/game/client/vgui_netgraphpanel.cpp @@ -492,6 +492,10 @@ void CNetGraphPanel::DrawTimes( vrect_t vrect, cmdinfo_t *cmdinfo, int x, int w, { i = ( m_OutgoingSequence - a ) & ( TIMINGS - 1 ); h = MIN( ( cmdinfo[i].cmd_lerp / 3.0 ) * LERP_HEIGHT, LERP_HEIGHT ); + if ( h < 0 ) + { + h = LERP_HEIGHT; + } rcFill.x = x + w -a - 1; rcFill.width = 1; @@ -514,7 +518,9 @@ void CNetGraphPanel::DrawTimes( vrect_t vrect, cmdinfo_t *cmdinfo, int x, int w, for ( j = start; j < h; j++ ) { - DrawLine(&rcFill, colors[j + extrap_point], 255 ); + int index = j + extrap_point; + Assert( (size_t)index < Q_ARRAYSIZE( colors ) ); + DrawLine(&rcFill, colors[ index ], 255 ); rcFill.y--; } } @@ -532,7 +538,9 @@ void CNetGraphPanel::DrawTimes( vrect_t vrect, cmdinfo_t *cmdinfo, int x, int w, for ( j = 0; j < h; j++ ) { - DrawLine(&rcFill, colors[j + oldh], 255 ); + int index = j + oldh; + Assert( (size_t)index < Q_ARRAYSIZE( colors ) ); + DrawLine(&rcFill, colors[ index ], 255 ); rcFill.y--; } } @@ -1533,7 +1541,7 @@ public: if ( netGraphPanel ) { netGraphPanel->SetParent( (Panel *)NULL ); - delete netGraphPanel; + netGraphPanel->MarkForDeletion(); netGraphPanel = NULL; } } |