mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 23:57:57 +00:00
engine: server: use soundlist to acquire random sounds for physics
This commit is contained in:
parent
c8e1ffe0dd
commit
7daa6c3451
@ -150,21 +150,9 @@ void SV_WaterMove( edict_t *ent )
|
||||
if( flags & FL_INWATER )
|
||||
{
|
||||
// leave the water.
|
||||
switch( COM_RandomLong( 0, 3 ))
|
||||
{
|
||||
case 0:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade1.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 1:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade2.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 2:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade3.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 3:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade4.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
}
|
||||
const char *snd = SoundList_GetRandom( EntityWaterExit );
|
||||
if( snd )
|
||||
SV_StartSound( ent, CHAN_BODY, snd, 1.0f, ATTN_NORM, 0, 100 );
|
||||
|
||||
ent->v.flags = flags & ~FL_INWATER;
|
||||
}
|
||||
@ -197,21 +185,9 @@ void SV_WaterMove( edict_t *ent )
|
||||
if( watertype == CONTENTS_WATER )
|
||||
{
|
||||
// entering the water
|
||||
switch( COM_RandomLong( 0, 3 ))
|
||||
{
|
||||
case 0:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade1.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 1:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade2.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 2:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade3.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
case 3:
|
||||
SV_StartSound( ent, CHAN_BODY, "player/pl_wade4.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
break;
|
||||
}
|
||||
const char *snd = SoundList_GetRandom( EntityWaterEnter );
|
||||
if( snd )
|
||||
SV_StartSound( ent, CHAN_BODY, snd, 1.0f, ATTN_NORM, 0, 100 );
|
||||
}
|
||||
|
||||
ent->v.flags = flags | FL_INWATER;
|
||||
|
@ -1384,7 +1384,9 @@ static void SV_CheckWaterTransition( edict_t *ent )
|
||||
if( ent->v.watertype == CONTENTS_EMPTY )
|
||||
{
|
||||
// just crossed into water
|
||||
SV_StartSound( ent, CHAN_AUTO, "player/pl_wade1.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
const char *snd = SoundList_GetRandom( PlayerWaterEnter );
|
||||
if( snd )
|
||||
SV_StartSound( ent, CHAN_AUTO, snd, 1.0f, ATTN_NORM, 0, 100 );
|
||||
ent->v.velocity[2] *= 0.5f;
|
||||
}
|
||||
|
||||
@ -1418,7 +1420,9 @@ static void SV_CheckWaterTransition( edict_t *ent )
|
||||
if( ent->v.watertype != CONTENTS_EMPTY )
|
||||
{
|
||||
// just crossed into water
|
||||
SV_StartSound( ent, CHAN_AUTO, "player/pl_wade2.wav", 1.0f, ATTN_NORM, 0, 100 );
|
||||
const char *snd = SoundList_GetRandom( PlayerWaterExit );
|
||||
if( snd )
|
||||
SV_StartSound( ent, CHAN_AUTO, snd, 1.0f, ATTN_NORM, 0, 100 );
|
||||
}
|
||||
ent->v.watertype = CONTENTS_EMPTY;
|
||||
ent->v.waterlevel = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user