X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=snd_main.c;h=ebf84b9bfd599e29601877a9e12971fa4116b872;hp=aab18140bfab0036098ff91f81b7a1bd2766ee45;hb=a66ee73e39edd25878ca5f5a58f35b125fffca29;hpb=f13419f00e3f8335e9a25498560a433597f28f50 diff --git a/snd_main.c b/snd_main.c index aab18140..ebf84b9b 100644 --- a/snd_main.c +++ b/snd_main.c @@ -778,8 +778,8 @@ void S_Init(void) if (Sys_CheckParm("-nosound")) { // dummy out Play and Play2 because mods stuffcmd that - Cmd_AddCommand(CF_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified"); - Cmd_AddCommand(CF_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified"); + Cmd_AddCommand(CF_CLIENT, "play", Cmd_NoOperation_f, "does nothing because -nosound was specified"); + Cmd_AddCommand(CF_CLIENT, "play2", Cmd_NoOperation_f, "does nothing because -nosound was specified"); return; } @@ -1226,7 +1226,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qbool isstatic, sfx_t *sfx) } else if (cl.entities[ch->entnum].state_current.active) { - dp_model_t *model; + model_t *model; //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]); model = CL_GetModelByIndex(cl.entities[ch->entnum].state_current.modelindex); if (model && model->soundfromcenter) @@ -2240,7 +2240,7 @@ void S_ExtraUpdate (void) S_PaintAndSubmit(); } -qbool S_LocalSound (const char *sound) +qbool S_LocalSoundEx (const char *sound, int chan, float fvol) { sfx_t *sfx; int ch_ind; @@ -2261,10 +2261,15 @@ qbool S_LocalSound (const char *sound) // fun fact: in Quake 1, this used -1 "replace any entity channel", // which we no longer support anyway // changed by Black in r4297 "Changed S_LocalSound to play multiple sounds at a time." - ch_ind = S_StartSound (cl.viewentity, 0, sfx, vec3_origin, 1, 0); + ch_ind = S_StartSound (cl.viewentity, chan, sfx, vec3_origin, fvol, 0); if (ch_ind < 0) return false; channels[ch_ind].flags |= CHANNELFLAG_LOCALSOUND; return true; } + +qbool S_LocalSound (const char *sound) +{ + return S_LocalSoundEx(sound, 0, 1); +}