mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
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:
parent
64df22aa8c
commit
9a2ba662bd
1 changed files with 21 additions and 15 deletions
|
@ -216,7 +216,7 @@ CL_ParseTEnt (void)
|
|||
{
|
||||
byte type;
|
||||
dlight_t *dl;
|
||||
int colorStart, colorLength, rnd;
|
||||
int colorStart, colorLength;
|
||||
int cnt = -1;
|
||||
explosion_t *ex;
|
||||
vec3_t pos;
|
||||
|
@ -246,16 +246,19 @@ CL_ParseTEnt (void)
|
|||
MSG_ReadCoordV (net_message, pos);
|
||||
R_SpikeEffect (pos);
|
||||
|
||||
if (rand () % 5)
|
||||
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
|
||||
else {
|
||||
rnd = rand () & 3;
|
||||
if (rnd == 1)
|
||||
switch (rand () % 20) {
|
||||
case 19:
|
||||
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);
|
||||
else
|
||||
break;
|
||||
case 17:
|
||||
case 16:
|
||||
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
|
||||
break;
|
||||
default:
|
||||
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -263,16 +266,19 @@ CL_ParseTEnt (void)
|
|||
MSG_ReadCoordV (net_message, pos);
|
||||
R_SuperSpikeEffect (pos);
|
||||
|
||||
if (rand () % 5)
|
||||
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
|
||||
else {
|
||||
rnd = rand () & 3;
|
||||
if (rnd == 1)
|
||||
switch (rand () % 20) {
|
||||
case 19:
|
||||
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);
|
||||
else
|
||||
break;
|
||||
case 17:
|
||||
case 16:
|
||||
S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
|
||||
break;
|
||||
default:
|
||||
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue