best = music_target;
if(music_trigger)
best = music_trigger;
- for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); )
+ for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); ) if(e.noise)
{
s0 = e.state;
if(getsoundtime(e, CHAN_VOICE) < 0)
{
precache_sound(e.noise);
sound(e, CHAN_VOICE, e.noise, 0, ATTN_NONE);
+ if(getsoundtime(e, CHAN_VOICE) < 0)
+ {
+ print("Cannot initialize sound ", e.noise, "\n");
+ strunzone(e.noise);
+ e.noise = string_null;
+ }
}
e.volume = vol;
e.fade_time = fai;
{
precache_sound(self.noise);
sound(self, CHAN_VOICE, self.noise, 0, ATTN_NONE);
+ if(getsoundtime(self, CHAN_VOICE) < 0)
+ {
+ print("Cannot initialize sound ", self.noise, "\n");
+ strunzone(self.noise);
+ self.noise = string_null;
+ }
}
}
return TRUE;
}
+void TargetMusic_RestoreGame();
void RestoreGame()
{
// Loaded from a save game
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1);
WeaponStats_Init();
+
+ TargetMusic_RestoreGame();
}
void SV_Shutdown()
else
target_music_sendto(MSG_INIT, 0);
}
+void TargetMusic_RestoreGame()
+{
+ for(self = world; (self = find(self, classname, "target_music")); )
+ {
+ if(self.targetname == "")
+ target_music_sendto(MSG_INIT, 1);
+ else
+ target_music_sendto(MSG_INIT, 0);
+ }
+}
// values:
// volume
// noise