cleanup sound

This commit is contained in:
ac-stef
2017-05-22 11:29:41 +02:00
parent e126faef15
commit 788baf6299
2 changed files with 7 additions and 3 deletions
+2 -3
View File
@@ -427,12 +427,11 @@ void voicecom(char *sound, char *text)
static int last = 0;
if(!last || lastmillis-last > 2000)
{
extern int voicecomsounds;
defformatstring(soundpath)("voicecom/%s", sound);
int s = audiomgr.findsound(soundpath, 0, gamesounds);
if(s < 0 || s < S_AFFIRMATIVE || s >= S_NULL) return;
if(!valid_voicecom(s)) return;
if(voicecomsounds>0) audiomgr.playsound(s, SP_HIGH);
if(s >= S_NICESHOT) // public
if(valid_voicecom_public(s)) // public
{
addmsg(SV_VOICECOM, "ri", s);
toserver(text);
+5
View File
@@ -69,12 +69,16 @@ enum
S_THANKS2,
S_AWESOME1,
S_AWESOME2,
// end: voicecoms
S_ITEMHELMET, // begin: Sounds for AssaultCube v1.1.0.4 onwards
S_HEARTBEAT,
S_KTFSCORE,
S_NULL
};
#define valid_voicecom(x) ((x) >= S_AFFIRMATIVE && (x) <= S_AWESOME2) // all voicecoms
#define valid_voicecom_public(x) ((x) >= S_NICESHOT && (x) <= S_AWESOME2) // voicecoms always sent to all players
// hardcoded music
enum
@@ -446,6 +450,7 @@ extern vector<soundconfig> gamesounds, mapsounds;
extern ov_callbacks oggcallbacks;
extern int soundvol;
extern int audiodebug;
extern int voicecomsounds;
extern audiomanager audiomgr;