From 881b13c2d2d798d9d76b9bd7ef63ea5ca457213d Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 4 Jul 2011 13:59:47 +0200 Subject: [PATCH] fix compile --- qcsrc/common/constants.qh | 2 -- qcsrc/common/util.qh | 4 ++++ qcsrc/server/miscfunctions.qc | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 86389c6b4..de0edbb31 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -444,7 +444,6 @@ float CH_PAIN = 6; // only on players and csqc float CH_PAIN_SINGLE = 6; // only on players and csqc float CH_PLAYER = 7; // only on players and entities #else -// FIXME convert back to float .... = float CH_INFO = 0; float CH_TRIGGER = -3; float CH_WEAPON_A = -1; @@ -458,7 +457,6 @@ float CH_WEAPON_B = -1; float CH_PAIN = -6; float CH_PAIN_SINGLE = 6; float CH_PLAYER = -7; -#define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0) #endif float ATTN_NONE = 0; diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 5a5792cb7..9071c1c7c 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -265,3 +265,7 @@ const float XENCODE_MAX = 21295; // 2*22*22*22-1 const float XENCODE_LEN = 5; string xencode(float f); float xdecode(string s); + +#ifndef COMPAT_XON010_CHANNELS +#define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0) +#endif diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 28a15d747..697049997 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1313,7 +1313,6 @@ void readlevelcvars(void) // Sound functions string precache_sound (string s) = #19; -void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8; float precache_sound_index (string s) = #19; #define SND_VOLUME 1 @@ -1345,12 +1344,24 @@ float sound_allowed(float dest, entity e) return TRUE; } +#ifdef COMPAT_XON010_CHANNELS +void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8; void sound(entity e, float chan, string samp, float vol, float atten) { if (!sound_allowed(MSG_BROADCAST, e)) return; sound_builtin(e, chan, samp, vol, atten); } +#else +#undef sound +void sound(entity e, float chan, string samp, float vol, float atten) +{ + if (!sound_allowed(MSG_BROADCAST, e)) + return; + sound7(e, chan, samp, vol, atten, 0, 0); +} +#endif + void soundtoat(float dest, entity e, vector o, float chan, string samp, float vol, float atten) { float entno, idx; -- 2.39.2