ugh, qw/source/cl_tent.c should have been committed with this.

Change random number generation in spike hits, only generate 1 random number, and use a case to pick the results.
This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-07-03 05:42:45 +00:00
parent 64df22aa8c
commit 9a2ba662bd

View file

@ -216,7 +216,7 @@ CL_ParseTEnt (void)
{ {
byte type; byte type;
dlight_t *dl; dlight_t *dl;
int colorStart, colorLength, rnd; int colorStart, colorLength;
int cnt = -1; int cnt = -1;
explosion_t *ex; explosion_t *ex;
vec3_t pos; vec3_t pos;
@ -246,16 +246,19 @@ CL_ParseTEnt (void)
MSG_ReadCoordV (net_message, pos); MSG_ReadCoordV (net_message, pos);
R_SpikeEffect (pos); R_SpikeEffect (pos);
if (rand () % 5) switch (rand () % 20) {
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1); case 19:
else {
rnd = rand () & 3;
if (rnd == 1)
S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
else if (rnd == 2) break;
case 18:
S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
else break;
case 17:
case 16:
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
break;
default:
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
} }
break; break;
@ -263,16 +266,19 @@ CL_ParseTEnt (void)
MSG_ReadCoordV (net_message, pos); MSG_ReadCoordV (net_message, pos);
R_SuperSpikeEffect (pos); R_SuperSpikeEffect (pos);
if (rand () % 5) switch (rand () % 20) {
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1); case 19:
else {
rnd = rand () & 3;
if (rnd == 1)
S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
else if (rnd == 2) break;
case 18:
S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
else break;
case 17:
case 16:
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1); S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
break;
default:
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
} }
break; break;