X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Ftarget_music.qc;h=f30e77af424007e8aebd4d8805c1fea2e19359f8;hb=6a28c11c8abd729c7f95ad7050d204aa2453d2ff;hp=b1957038eb4eb9b7c1a97574713ceed3e42bf2e4;hpb=f0d3b4fa8ab12a5b30bfc43f972bda35a9310691;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index b1957038e..f30e77af4 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -2,6 +2,7 @@ float music_disabled; entity music_default; entity music_target; entity music_trigger; +// FIXME also control bgmvolume here, to not require a target_music for the default track. .float state; .float lastvol; @@ -19,7 +20,7 @@ void TargetMusic_Advance() for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); ) if(e.noise) { vol0 = e.lastvol; - if(getsoundtime(e, CHAN_VOICE) < 0) + if(getsoundtime(e, CH_BGM_SINGLE) < 0) { vol0 = -1; } @@ -39,20 +40,20 @@ void TargetMusic_Advance() else e.state = 0; } - vol = e.state * e.volume * cvar("bgmvolume"); + vol = e.state * e.volume * autocvar_bgmvolume; if(vol != vol0) { if(vol0 < 0) - sound(e, CHAN_VOICE, e.noise, vol, ATTN_NONE); // restart + sound(e, CH_BGM_SINGLE, e.noise, vol, ATTEN_NONE); // restart else - sound(e, CHAN_VOICE, "", vol, ATTN_NONE); + sound(e, CH_BGM_SINGLE, "", vol, ATTEN_NONE); e.lastvol = vol; } } music_trigger = world; if(best) - bgmtime = getsoundtime(best, CHAN_VOICE); + bgmtime = getsoundtime(best, CH_BGM_SINGLE); else bgmtime = gettime(GETTIME_CDTRACK); } @@ -87,10 +88,10 @@ void Net_TargetMusic() strunzone(e.noise); e.noise = strzone(noi); precache_sound(e.noise); - sound(e, CHAN_VOICE, e.noise, 0, ATTN_NONE); - if(getsoundtime(e, CHAN_VOICE) < 0) + sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE); + if(getsoundtime(e, CH_BGM_SINGLE) < 0) { - print("Cannot initialize sound ", e.noise, "\n"); + print(sprintf(_("Cannot initialize sound %s\n"), e.noise)); strunzone(e.noise); e.noise = string_null; } @@ -106,6 +107,7 @@ void Net_TargetMusic() if(!music_disabled) { e.state = 2; + cvar_settemp("music_playlist_index", "-1"); // don't use playlists localcmd("cd stop\n"); // just in case music_disabled = 1; } @@ -175,10 +177,10 @@ void Ent_ReadTriggerMusic() if(self.noise != s) { precache_sound(self.noise); - sound(self, CHAN_VOICE, self.noise, 0, ATTN_NONE); - if(getsoundtime(self, CHAN_VOICE) < 0) + sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE); + if(getsoundtime(self, CH_BGM_SINGLE) < 0) { - print("Cannot initialize sound ", self.noise, "\n"); + print(sprintf(_("Cannot initialize sound %s\n"), self.noise)); strunzone(self.noise); self.noise = string_null; }