Browse Source

Fixes ValveSoftware/halflife#1536

This is merely to keep the VC++ Debug builds happy and addresses cases
where variables where being used without being initalized. There should be
no visible changes apart from non-functional side effects to the users of
Release builds.
Thanks to @fabiosarts for finding and reporting these problems.
Thanks to @LevShisterov for suggeting how to fix geiger.cpp files, which I
followed closely except using <= 800 instead of < 800.
Dominik Tugend 4 years ago
parent
commit
062078aedd

+ 2
- 6
cl_dll/geiger.cpp View File

@@ -68,14 +68,10 @@ int CHudGeiger::Draw (float flTime)
68 68
 	int rg[3];
69 69
 	int i;
70 70
 	
71
-	if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
71
+	if (m_iGeigerRange <= 800 && m_iGeigerRange > 0)
72 72
 	{
73 73
 		// peicewise linear is better than continuous formula for this
74
-		if (m_iGeigerRange > 800)
75
-		{
76
-			pct = 0;			//Con_Printf ( "range > 800\n");
77
-		}
78
-		else if (m_iGeigerRange > 600)
74
+		if (m_iGeigerRange > 600)
79 75
 		{
80 76
 			pct = 2;
81 77
 			flvol = 0.4;		//Con_Printf ( "range > 600\n");

+ 1
- 2
cl_dll/message.cpp View File

@@ -147,13 +147,13 @@ void CHudMessage::MessageScanNextChar( void )
147 147
 	srcGreen = m_parms.pMessage->g1;
148 148
 	srcBlue = m_parms.pMessage->b1;
149 149
 	blend = 0;	// Pure source
150
+	destRed = destGreen = destBlue = 0;
150 151
 
151 152
 	switch( m_parms.pMessage->effect )
152 153
 	{
153 154
 	// Fade-in / Fade-out
154 155
 	case 0:
155 156
 	case 1:
156
-		destRed = destGreen = destBlue = 0;
157 157
 		blend = m_parms.fadeBlend;
158 158
 		break;
159 159
 
@@ -168,7 +168,6 @@ void CHudMessage::MessageScanNextChar( void )
168 168
 		{
169 169
 			float deltaTime = m_parms.time - m_parms.charTime;
170 170
 
171
-			destRed = destGreen = destBlue = 0;
172 171
 			if ( m_parms.time > m_parms.fadeTime )
173 172
 			{
174 173
 				blend = m_parms.fadeBlend;

+ 2
- 6
dmc/cl_dll/geiger.cpp View File

@@ -68,14 +68,10 @@ int CHudGeiger::Draw (float flTime)
68 68
 	int rg[3];
69 69
 	int i;
70 70
 	
71
-	if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
71
+	if (m_iGeigerRange <= 800 && m_iGeigerRange > 0)
72 72
 	{
73 73
 		// peicewise linear is better than continuous formula for this
74
-		if (m_iGeigerRange > 800)
75
-		{
76
-			pct = 0;			//Con_Printf ( "range > 800\n");
77
-		}
78
-		else if (m_iGeigerRange > 600)
74
+		if (m_iGeigerRange > 600)
79 75
 		{
80 76
 			pct = 2;
81 77
 			flvol = 0.4;		//Con_Printf ( "range > 600\n");

+ 1
- 2
dmc/cl_dll/message.cpp View File

@@ -143,13 +143,13 @@ void CHudMessage::MessageScanNextChar( void )
143 143
 	srcGreen = m_parms.pMessage->g1;
144 144
 	srcBlue = m_parms.pMessage->b1;
145 145
 	blend = 0;	// Pure source
146
+	destRed = destGreen = destBlue = 0;
146 147
 
147 148
 	switch( m_parms.pMessage->effect )
148 149
 	{
149 150
 	// Fade-in / Fade-out
150 151
 	case 0:
151 152
 	case 1:
152
-		destRed = destGreen = destBlue = 0;
153 153
 		blend = m_parms.fadeBlend;
154 154
 		break;
155 155
 
@@ -164,7 +164,6 @@ void CHudMessage::MessageScanNextChar( void )
164 164
 		{
165 165
 			float deltaTime = m_parms.time - m_parms.charTime;
166 166
 
167
-			destRed = destGreen = destBlue = 0;
168 167
 			if ( m_parms.time > m_parms.fadeTime )
169 168
 			{
170 169
 				blend = m_parms.fadeBlend;

+ 2
- 6
ricochet/cl_dll/geiger.cpp View File

@@ -68,14 +68,10 @@ int CHudGeiger::Draw (float flTime)
68 68
 	int rg[3];
69 69
 	int i;
70 70
 	
71
-	if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
71
+	if (m_iGeigerRange <= 800 && m_iGeigerRange > 0)
72 72
 	{
73 73
 		// peicewise linear is better than continuous formula for this
74
-		if (m_iGeigerRange > 800)
75
-		{
76
-			pct = 0;			//Con_Printf ( "range > 800\n");
77
-		}
78
-		else if (m_iGeigerRange > 600)
74
+		if (m_iGeigerRange > 600)
79 75
 		{
80 76
 			pct = 2;
81 77
 			flvol = 0.4;		//Con_Printf ( "range > 600\n");

+ 1
- 2
ricochet/cl_dll/message.cpp View File

@@ -143,13 +143,13 @@ void CHudMessage::MessageScanNextChar( void )
143 143
 	srcGreen = m_parms.pMessage->g1;
144 144
 	srcBlue = m_parms.pMessage->b1;
145 145
 	blend = 0;	// Pure source
146
+	destRed = destGreen = destBlue = 0;
146 147
 
147 148
 	switch( m_parms.pMessage->effect )
148 149
 	{
149 150
 	// Fade-in / Fade-out
150 151
 	case 0:
151 152
 	case 1:
152
-		destRed = destGreen = destBlue = 0;
153 153
 		blend = m_parms.fadeBlend;
154 154
 		break;
155 155
 
@@ -164,7 +164,6 @@ void CHudMessage::MessageScanNextChar( void )
164 164
 		{
165 165
 			float deltaTime = m_parms.time - m_parms.charTime;
166 166
 
167
-			destRed = destGreen = destBlue = 0;
168 167
 			if ( m_parms.time > m_parms.fadeTime )
169 168
 			{
170 169
 				blend = m_parms.fadeBlend;

Loading…
Cancel
Save