diff --git a/engine/server/sv_move.c b/engine/server/sv_move.c index e62bfd46..25cd894a 100644 --- a/engine/server/sv_move.c +++ b/engine/server/sv_move.c @@ -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; diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 29fd6a9f..f65954fd 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -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;