client: fix Stupid MSVC6 Bug variable declaration

This commit is contained in:
Alibek Omarov 2023-09-09 03:00:16 +03:00
parent 0b242a0bc9
commit 7f841974b2
10 changed files with 30 additions and 18 deletions

View File

@ -101,7 +101,8 @@ int CHudDeathNotice :: Draw( float flTime )
// How many death messages are there. // How many death messages are there.
for( int i = 0;i < MAX_DEATHNOTICES; i++) int i;
for( i = 0;i < MAX_DEATHNOTICES; i++)
{ {
if(rgDeathNoticeList[i].iId == 0) if(rgDeathNoticeList[i].iId == 0)
break; break;
@ -236,7 +237,8 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
gHUD.m_Spectator.DeathMessage(victim); gHUD.m_Spectator.DeathMessage(victim);
for ( int i = 0; i < MAX_DEATHNOTICES; i++ ) int i;
for ( i = 0; i < MAX_DEATHNOTICES; i++ )
{ {
if ( rgDeathNoticeList[i].iId == 0 ) if ( rgDeathNoticeList[i].iId == 0 )
break; break;

View File

@ -385,7 +385,8 @@ int CHudHealth::DrawDamage(float flTime)
ScaleColors(r, g, b, a); ScaleColors(r, g, b, a);
// Draw all the items // Draw all the items
for (int i = 0; i < NUM_DMG_TYPES; i++) int i;
for ( i = 0; i < NUM_DMG_TYPES; i++)
{ {
if (m_bitsDamage & giDmgFlags[i]) if (m_bitsDamage & giDmgFlags[i])
{ {

View File

@ -424,7 +424,8 @@ void CHud :: VidInit( void )
// count the number of sprites of the appropriate res // count the number of sprites of the appropriate res
m_iSpriteCount = 0; m_iSpriteCount = 0;
client_sprite_t *p = m_pSpriteList; client_sprite_t *p = m_pSpriteList;
for ( int j = 0; j < m_iSpriteCountAllRes; j++ ) int j;
for ( j = 0; j < m_iSpriteCountAllRes; j++ )
{ {
if ( p->iRes == m_iRes ) if ( p->iRes == m_iRes )
m_iSpriteCount++; m_iSpriteCount++;

View File

@ -220,7 +220,8 @@ int CHud :: DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int
int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b ) int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b )
{ {
// find the end of the string // find the end of the string
for ( char *szIt = szString; *szIt != 0; szIt++ ) char *szIt;
for ( szIt = szString; *szIt != 0; szIt++ )
{ // we should count the length? { // we should count the length?
} }

View File

@ -84,8 +84,8 @@ int CHudMenu :: Draw( float flTime )
// draw the menu, along the left-hand side of the screen // draw the menu, along the left-hand side of the screen
// count the number of newlines // count the number of newlines
int nlc = 0; int nlc = 0, i;
for ( int i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ ) for ( i = 0; i < MAX_MENU_STRING && g_szMenuString[i] != '\0'; i++ )
{ {
if ( g_szMenuString[i] == '\n' ) if ( g_szMenuString[i] == '\n' )
nlc++; nlc++;

View File

@ -174,7 +174,8 @@ void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIn
} }
// find an empty string slot // find an empty string slot
for ( int i = 0; i < MAX_LINES; i++ ) int i;
for ( i = 0; i < MAX_LINES; i++ )
{ {
if ( ! *g_szLineBuffer[i] ) if ( ! *g_szLineBuffer[i] )
break; break;

View File

@ -336,7 +336,8 @@ void DLLEXPORT HUD_DrawTransparentTriangles( void )
g_ParticleSystemManager.RenderTransparent(); g_ParticleSystemManager.RenderTransparent();
// Render laser beams // Render laser beams
for(int i = 0;i < gEngfuncs.GetMaxClients();i++) int i;
for(i = 0;i < gEngfuncs.GetMaxClients();i++)
{ {
cl_entity_t *player = gEngfuncs.GetEntityByIndex(i); cl_entity_t *player = gEngfuncs.GetEntityByIndex(i);
if(player != NULL && g_iClientLasersEnabled[i]) if(player != NULL && g_iClientLasersEnabled[i])

View File

@ -275,9 +275,9 @@ public:
void BuildButtons() void BuildButtons()
{ {
int iButtonPosY = LIST_BUTTON_Y; int iButtonPosY = LIST_BUTTON_Y, i;
for( int i = 0;i < m_pItemArray->size; i++ ) for( i = 0;i < m_pItemArray->size; i++ )
{ {
playeritem_t *pItem = &m_pItemArray->array[i]; playeritem_t *pItem = &m_pItemArray->array[i];
ItemButtonShaded *newButton; ItemButtonShaded *newButton;

View File

@ -276,7 +276,8 @@ void ScorePanel::Update()
void ScorePanel::SortTeams() void ScorePanel::SortTeams()
{ {
// clear out team scores // clear out team scores
for ( int i = 1; i <= m_iNumTeams; i++ ) int i;
for ( i = 1; i <= m_iNumTeams; i++ )
{ {
if ( !g_TeamInfo[i].scores_overriden ) if ( !g_TeamInfo[i].scores_overriden )
g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0; g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0;
@ -293,7 +294,8 @@ void ScorePanel::SortTeams()
continue; // skip over players who are not in a team continue; // skip over players who are not in a team
// find what team this player is in // find what team this player is in
for ( int j = 1; j <= m_iNumTeams; j++ ) int j;
for ( j = 1; j <= m_iNumTeams; j++ )
{ {
if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) ) if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) )
break; break;
@ -435,7 +437,8 @@ void ScorePanel::SortPlayers( int iTeam, char *team )
void ScorePanel::RebuildTeams() void ScorePanel::RebuildTeams()
{ {
// clear out player counts from teams // clear out player counts from teams
for ( int i = 1; i <= m_iNumTeams; i++ ) int i;
for ( i = 1; i <= m_iNumTeams; i++ )
{ {
g_TeamInfo[i].players = 0; g_TeamInfo[i].players = 0;
} }
@ -452,7 +455,8 @@ void ScorePanel::RebuildTeams()
continue; // skip over players who are not in a team continue; // skip over players who are not in a team
// is this player in an existing team? // is this player in an existing team?
for ( int j = 1; j <= m_iNumTeams; j++ ) int j;
for ( j = 1; j <= m_iNumTeams; j++ )
{ {
if ( g_TeamInfo[j].name[0] == '\0' ) if ( g_TeamInfo[j].name[0] == '\0' )
break; break;
@ -513,8 +517,8 @@ void ScorePanel::FillGrid()
} }
bool bNextRowIsGap = false; bool bNextRowIsGap = false;
int row;
for(int row=0; row < NUM_ROWS; row++) for(row=0; row < NUM_ROWS; row++)
{ {
CGrid *pGridRow = &m_PlayerGrids[row]; CGrid *pGridRow = &m_PlayerGrids[row];
pGridRow->SetRowUnderline(0, false, 0, 0, 0, 0, 0); pGridRow->SetRowUnderline(0, false, 0, 0, 0, 0, 0);

View File

@ -1831,7 +1831,8 @@ int TheWastesViewport::MsgFunc_TeamScore( const char *pszName, int iSize, void *
char *TeamName = READ_STRING(); char *TeamName = READ_STRING();
// find the team matching the name // find the team matching the name
for ( int i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ ) int i;
for ( i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ )
{ {
if ( !stricmp( TeamName, g_TeamInfo[i].name ) ) if ( !stricmp( TeamName, g_TeamInfo[i].name ) )
break; break;