]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
sound8
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 11:29:36 +0000 (22:29 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 7 Nov 2015 11:29:36 +0000 (22:29 +1100)
12 files changed:
qcsrc/common/constants.qh
qcsrc/common/items/inventory.qh
qcsrc/common/mutators/mutator/superspec/superspec.qc
qcsrc/common/sounds/all.qc [new file with mode: 0644]
qcsrc/common/sounds/all.qh
qcsrc/common/sounds/sound.qh
qcsrc/server/_all.qh
qcsrc/server/autocvars.qh
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh

index 80468a62b7a8d2a308dfeae29fca973ef11f14c0..8d8e8df19fecc4965ebf3242946f04282d972d47 100644 (file)
@@ -164,34 +164,6 @@ const int SP_DMG = 10;
 const int SP_DMGTAKEN = 11;
 // game mode specific indices are not in common/, but in server/scores_rules.qc!
 
-const int CH_INFO = 0;
-const int CH_TRIGGER = -3;
-const int CH_WEAPON_A = -1;
-const int CH_WEAPON_SINGLE = 1;
-const int CH_VOICE = -2;
-const int CH_BGM_SINGLE = 8;
-const int CH_AMBIENT = -9;
-const int CH_TRIGGER_SINGLE = 3;
-const int CH_SHOTS = -4;
-const int CH_SHOTS_SINGLE = 4;
-const int CH_WEAPON_B = -1;
-const int CH_PAIN = -6;
-const int CH_PAIN_SINGLE = 6;
-const int CH_PLAYER = -7;
-const int CH_PLAYER_SINGLE = 7;
-const int CH_TUBA_SINGLE = 5;
-
-const float ATTEN_NONE = 0;
-const float ATTEN_MIN = 0.015625;
-const float ATTEN_NORM = 0.5;
-const float ATTEN_LARGE = 1;
-const float ATTEN_IDLE = 2;
-const float ATTEN_STATIC = 3;
-const float ATTEN_MAX = 3.984375;
-
-const float VOL_BASE = 0.7;
-const float VOL_BASEVOICE = 1.0;
-
 // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
 const int PROJECTILE_ELECTRO = 1;
 const int PROJECTILE_ROCKET = 2;
index 4ea37899432ac1aace4ac4e42a3bd240d12178a0..f748dda88405d286d73cb0eab68f84431eda96ff 100644 (file)
@@ -48,7 +48,7 @@ bool Inventory_Send(entity this, entity to, int sf)
 {
     WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY);
     entity e = self.owner;
-    if (/*IS_SPEC(e)*/ (e.classname == "spectator")) e = e.enemy;
+    if (IS_SPEC(e)) e = e.enemy;
     Inventory data = e.inventory;
     Inventory_Write(data);
     return true;
index 416df75b4ffe51c8a68a5490d196b6c84506caf8..887b1842345098eb42b9d70d2468feb04a0be58c 100644 (file)
@@ -102,7 +102,7 @@ MUTATOR_HOOKFUNCTION(superspec, ItemTouch)
        entity _item = self;
 
        entity e;
-       FOR_EACH_SPEC(e)
+       FOR_EACH_CLIENT(e) if (IS_SPEC(e) || IS_OBSERVER(e))
        {
                setself(e);
                if(self.superspec_flags & SSF_ITEMMSG)
diff --git a/qcsrc/common/sounds/all.qc b/qcsrc/common/sounds/all.qc
new file mode 100644 (file)
index 0000000..92c5ef0
--- /dev/null
@@ -0,0 +1,144 @@
+#ifdef SVQC
+
+bool autocvar_bot_sound_monopoly;
+
+.entity realowner;
+bool sound_allowed(int to, entity e)
+{
+       for ( ; ; )
+       {
+               if (e.classname == "body") e = e.enemy;
+               else if (e.realowner && e.realowner != e) e = e.realowner;
+               else if (e.owner && e.owner != e) e = e.owner;
+               else break;
+       }
+       // sounds to self may always pass
+       if (to == MSG_ONE && e == msg_entity) return true;
+       // sounds by players can be removed
+       if (autocvar_bot_sound_monopoly && IS_REAL_CLIENT(e)) return false;
+       // anything else may pass
+       return true;
+}
+
+/** hack: string precache_sound(string s) = #19; */
+int precache_sound_index(string s) = #19;
+
+const int SVC_SOUND = 6;
+const int SVC_STOPSOUND = 16;
+
+const int SND_VOLUME = BIT(0);
+const int SND_ATTENUATION = BIT(1);
+const int SND_LARGEENTITY = BIT(3);
+const int SND_LARGESOUND = BIT(4);
+
+void soundtoat(int to, entity e, vector o, int chan, string samp, float vol, float attenu)
+{
+       if (!sound_allowed(to, e)) return;
+       int entno = etof(e);
+       int idx = precache_sound_index(samp);
+       attenu = floor(attenu * 64);
+       vol = floor(vol * 255);
+       int sflags = 0;
+       if (vol != 255) sflags |= SND_VOLUME;
+       if (attenu != 64) sflags |= SND_ATTENUATION;
+       if (entno >= 8192 || chan < 0 || chan > 7) sflags |= SND_LARGEENTITY;
+       if (idx >= 256) sflags |= SND_LARGESOUND;
+       WriteByte(to, SVC_SOUND);
+       WriteByte(to, sflags);
+       if (sflags & SND_VOLUME) WriteByte(to, vol);
+       if (sflags & SND_ATTENUATION) WriteByte(to, attenu);
+       if (sflags & SND_LARGEENTITY)
+       {
+               WriteShort(to, entno);
+               WriteByte(to, chan);
+       }
+       else
+       {
+               WriteShort(to, (entno << 3) | chan);
+       }
+       if (sflags & SND_LARGESOUND) WriteShort(to, idx);
+       else WriteByte(to, idx);
+       WriteCoord(to, o.x);
+       WriteCoord(to, o.y);
+       WriteCoord(to, o.z);
+}
+
+void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten)
+{
+       if (!sound_allowed(_dest, e)) return;
+       vector o = e.origin + 0.5 * (e.mins + e.maxs);
+       soundtoat(_dest, e, o, chan, samp, vol, _atten);
+}
+void soundat(entity e, vector o, int chan, string samp, float vol, float _atten)
+{
+       soundtoat(((chan & 8) ? MSG_ALL : MSG_BROADCAST), e, o, chan, samp, vol, _atten);
+}
+void stopsoundto(int _dest, entity e, int chan)
+{
+       if (!sound_allowed(_dest, e)) return;
+       int entno = num_for_edict(e);
+       if (entno >= 8192 || chan < 0 || chan > 7)
+       {
+               int idx = precache_sound_index(SND(Null));
+               int sflags = SND_LARGEENTITY;
+               if (idx >= 256) sflags |= SND_LARGESOUND;
+               WriteByte(_dest, SVC_SOUND);
+               WriteByte(_dest, sflags);
+               WriteShort(_dest, entno);
+               WriteByte(_dest, chan);
+               if (sflags & SND_LARGESOUND) WriteShort(_dest, idx);
+               else WriteByte(_dest, idx);
+               WriteCoord(_dest, e.origin.x);
+               WriteCoord(_dest, e.origin.y);
+               WriteCoord(_dest, e.origin.z);
+       }
+       else
+       {
+               WriteByte(_dest, SVC_STOPSOUND);
+               WriteShort(_dest, entno * 8 + chan);
+       }
+}
+void stopsound(entity e, int chan)
+{
+       if (!sound_allowed(MSG_BROADCAST, e)) return;
+       stopsoundto(MSG_BROADCAST, e, chan); // unreliable, gets there fast
+       stopsoundto(MSG_ALL, e, chan);       // in case of packet loss
+}
+
+void play2(entity e, string filename)
+{
+       msg_entity = e;
+       soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
+}
+
+.float spamtime;
+/** use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame) */
+float spamsound(entity e, int chan, string samp, float vol, float _atten)
+{
+       if (!sound_allowed(MSG_BROADCAST, e)) return false;
+       if (time > e.spamtime)
+       {
+               e.spamtime = time;
+               _sound(e, chan, samp, vol, _atten);
+               return true;
+       }
+       return false;
+}
+
+void play2team(float t, string filename)
+{
+       if (autocvar_bot_sound_monopoly) return;
+       entity head;
+       FOR_EACH_REALPLAYER(head)
+       {
+               if (head.team == t) play2(head, filename);
+       }
+}
+
+void play2all(string samp)
+{
+       if (autocvar_bot_sound_monopoly) return;
+       _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
+}
+
+#endif
index 4ad0e9b102cbc214eaf01876ecd83ba1f9f841c1..e81206cd13f1f12d3f9c442bae8e0550c44c884b 100644 (file)
@@ -22,5 +22,5 @@ PRECACHE(Sounds) {
 
 SOUND(Null, "misc/null");
 #include "all.inc"
-
+#include "all.qc"
 #endif
index dfc80e390a6696ab111f881e693158766021cba6..36bdaa833085db167c5190b946d7a701e5592faa 100644 (file)
@@ -1,6 +1,34 @@
 #ifndef SOUND_H
 #define SOUND_H
 
+const int CH_INFO = 0;
+const int CH_TRIGGER = -3;
+const int CH_WEAPON_A = -1;
+const int CH_WEAPON_SINGLE = 1;
+const int CH_VOICE = -2;
+const int CH_BGM_SINGLE = 8;
+const int CH_AMBIENT = -9;
+const int CH_TRIGGER_SINGLE = 3;
+const int CH_SHOTS = -4;
+const int CH_SHOTS_SINGLE = 4;
+const int CH_WEAPON_B = -1;
+const int CH_PAIN = -6;
+const int CH_PAIN_SINGLE = 6;
+const int CH_PLAYER = -7;
+const int CH_PLAYER_SINGLE = 7;
+const int CH_TUBA_SINGLE = 5;
+
+const float ATTEN_NONE = 0;
+const float ATTEN_MIN = 0.015625;
+const float ATTEN_NORM = 0.5;
+const float ATTEN_LARGE = 1;
+const float ATTEN_IDLE = 2;
+const float ATTEN_STATIC = 3;
+const float ATTEN_MAX = 3.984375;
+
+const float VOL_BASE = 0.7;
+const float VOL_BASEVOICE = 1.0;
+
 // Play all sounds via sound7, for access to the extra channels.
 // Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
 #ifdef SVQC
 #endif
 #define sound(e, c, s, v, a) _sound(e, c, Sound_fixpath(s), v, a)
 
+/**
+ * because sound7 didn't have origin
+ *
+ * @param e sound owner
+ * @param o sound origin
+ * @param chan sound channel
+ * @param samp sound filename
+ * @param vol sound volume
+ * @param atten sound attenuation
+ * @param speed
+ * @param sf
+ */
+#define sound8(e, o, chan, samp, vol, atten, speed, sf) \
+       do \
+       { \
+               entity __e = e; \
+               vector old_origin = __e.origin; \
+               vector old_mins = __e.mins; \
+               vector old_maxs = __e.maxs; \
+               setorigin(__e, o); \
+               setsize(__e, '0 0 0', '0 0 0'); \
+               sound7(__e, chan, samp, vol, atten, speed, sf); \
+               setorigin(__e, old_origin); \
+               setsize(__e, old_mins, old_maxs); \
+       } \
+       while (0)
+
 CLASS(Sound, Object)
        ATTRIB(Sound, m_id, int, 0)
        ATTRIB(Sound, sound_str, string(), func_null)
@@ -28,24 +83,24 @@ CLASS(Sound, Object)
        #define Sound_fixpath(this) _Sound_fixpath((this).sound_str())
        string _Sound_fixpath(string base)
        {
-        if (base == "") return string_null;
-        #define extensions(x) \
-            x(wav) \
-            x(ogg) \
-            x(flac) \
-            /**/
-        string full, relative;
-        #define tryext(ext) { if (fexists(full = strcat("sound/", relative = strcat(base, "." #ext)))) break; }
-        do
-        {
-            extensions(tryext);
+               if (base == "") return string_null;
+               #define extensions(x) \
+                       x(wav) \
+                       x(ogg) \
+                       x(flac) \
+                       /**/
+               string full, relative;
+               #define tryext(ext) { if (fexists(full = strcat("sound/", relative = strcat(base, "." #ext)))) break; }
+               do
+               {
+                       extensions(tryext);
 #undef tryext
 #undef extensions
-            LOG_WARNINGF("Missing sound: \"%s\"\n", full);
-            return string_null;
-        }
-        while (0);
-        return relative;
+                       LOG_WARNINGF("Missing sound: \"%s\"\n", full);
+                       return string_null;
+               }
+               while (0);
+               return relative;
        }
        METHOD(Sound, sound_precache, void(entity this))
        {
index 3693726bbd90418ec2161c1304b12b2d929a3237..cbda56873aaa9091b3774b298fc6641954f46b0b 100644 (file)
@@ -1,6 +1,36 @@
 #ifndef SERVER_ALL_H
 #define SERVER_ALL_H
 
+int maxclients;
+
+const string STR_PLAYER = "player";
+const string STR_SPECTATOR = "spectator";
+const string STR_OBSERVER = "observer";
+
+#define IS_PLAYER(v) ((v).classname == STR_PLAYER)
+#define IS_SPEC(v) ((v).classname == STR_SPECTATOR)
+#define IS_OBSERVER(v) ((v).classname == STR_OBSERVER)
+
+#define IS_CLIENT(v) (v.flags & FL_CLIENT)
+#define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT)
+#define IS_REAL_CLIENT(v) (clienttype(v) == CLIENTTYPE_REAL)
+#define IS_NOT_A_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)
+
+#define IS_MONSTER(v) (v.flags & FL_MONSTER)
+#define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
+#define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
+
+#define FOR_EACH_CLIENTSLOT(v) for (v = world; (v = nextent(v)) && (num_for_edict(v) <= maxclients); )
+#define FOR_EACH_CLIENT(v) FOR_EACH_CLIENTSLOT(v) if (IS_CLIENT(v))
+#define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if (IS_REAL_CLIENT(v))
+
+#define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if (IS_PLAYER(v))
+#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (IS_SPEC(v))
+#define FOR_EACH_OBSERVER(v) FOR_EACH_CLIENT(v) if (IS_OBSERVER(v))
+#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if (IS_PLAYER(v))
+
+#define FOR_EACH_MONSTER(v) for (v = world; (v = findflags(v, flags, FL_MONSTER)) != world; )
+
 #include "../common/effects/all.qh"
 #include "../common/models/all.qh"
 #include "../common/sounds/all.qh"
index 2910eb9bb8a7f46b559acb6ff7854d757b073f88..6cd7e2395a2acd17b62a8862691e62c7d52e6298 100644 (file)
@@ -55,7 +55,6 @@ bool autocvar_bot_navigation_ignoreplayers;
 bool autocvar_bot_nofire;
 #define autocvar_bot_number cvar("bot_number")
 #define autocvar_bot_prefix cvar_string("bot_prefix")
-bool autocvar_bot_sound_monopoly;
 #define autocvar_bot_suffix cvar_string("bot_suffix")
 bool autocvar_bot_usemodelnames;
 int autocvar_bot_vs_human;
index 95b13f1c7fa06d3ce7ebb333dd42f87725050c03..c1ea1c6c61dcab81aa2df27e52f5b10377605d4e 100644 (file)
@@ -9,8 +9,6 @@ const int FL_NO_WEAPON_STAY = BIT(17);
 const int FL_SPAWNING = BIT(18);
 const int FL_PICKUPITEMS = BIT(19);
 
-const int SVC_SOUND = 6;
-const int SVC_STOPSOUND = 16;
 const int SVC_SETVIEW = 5;
 
 const int RESPAWN_FORCE = 1;
index 64157162cc0deb72ab2651435ddcff1faf5ac771..094eb453192a6e7b48ce2204d39ea18acdc150d9 100644 (file)
@@ -54,8 +54,6 @@ void UpdateFrags(entity player, float f);
 
 float team1_score, team2_score, team3_score, team4_score;
 
-float maxclients;
-
 // flag set on worldspawn so that the code knows if it is dedicated or not
 float server_is_dedicated;
 
index 2b00fbffa04615cdf09bce81658ff57cd1d644a1..d12a903778571195c13999e904daa605330ba24d 100644 (file)
@@ -703,183 +703,6 @@ void readplayerstartcvars()
        warmup_start_ammo_fuel = max(0, warmup_start_ammo_fuel);
 }
 
-float sound_allowed(float destin, entity e)
-{
-    // sounds from world may always pass
-    for (;;)
-    {
-        if (e.classname == "body")
-            e = e.enemy;
-       else if (e.realowner && e.realowner != e)
-            e = e.realowner;
-       else if (e.owner && e.owner != e)
-            e = e.owner;
-        else
-            break;
-    }
-    // sounds to self may always pass
-    if (destin == MSG_ONE)
-        if (e == msg_entity)
-            return true;
-    // sounds by players can be removed
-    if (autocvar_bot_sound_monopoly)
-        if (IS_REAL_CLIENT(e))
-            return false;
-    // anything else may pass
-    return true;
-}
-
-void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float attenu)
-{
-    float entno, idx;
-
-    if (!sound_allowed(_dest, e))
-        return;
-
-    entno = num_for_edict(e);
-    idx = precache_sound_index(samp);
-
-    int sflags;
-    sflags = 0;
-
-    attenu = floor(attenu * 64);
-    vol = floor(vol * 255);
-
-    if (vol != 255)
-        sflags |= SND_VOLUME;
-    if (attenu != 64)
-        sflags |= SND_ATTENUATION;
-    if (entno >= 8192 || chan < 0 || chan > 7)
-        sflags |= SND_LARGEENTITY;
-    if (idx >= 256)
-        sflags |= SND_LARGESOUND;
-
-    WriteByte(_dest, SVC_SOUND);
-    WriteByte(_dest, sflags);
-    if (sflags & SND_VOLUME)
-        WriteByte(_dest, vol);
-    if (sflags & SND_ATTENUATION)
-        WriteByte(_dest, attenu);
-    if (sflags & SND_LARGEENTITY)
-    {
-        WriteShort(_dest, entno);
-        WriteByte(_dest, chan);
-    }
-    else
-    {
-        WriteShort(_dest, entno * 8 + chan);
-    }
-    if (sflags & SND_LARGESOUND)
-        WriteShort(_dest, idx);
-    else
-        WriteByte(_dest, idx);
-
-    WriteCoord(_dest, o.x);
-    WriteCoord(_dest, o.y);
-    WriteCoord(_dest, o.z);
-}
-void soundto(float _dest, entity e, float chan, string samp, float vol, float _atten)
-{
-    vector o;
-
-    if (!sound_allowed(_dest, e))
-        return;
-
-    o = e.origin + 0.5 * (e.mins + e.maxs);
-    soundtoat(_dest, e, o, chan, samp, vol, _atten);
-}
-void soundat(entity e, vector o, float chan, string samp, float vol, float _atten)
-{
-    soundtoat(((chan & 8) ? MSG_ALL : MSG_BROADCAST), e, o, chan, samp, vol, _atten);
-}
-void stopsoundto(float _dest, entity e, float chan)
-{
-    float entno;
-
-    if (!sound_allowed(_dest, e))
-        return;
-
-    entno = num_for_edict(e);
-
-    if (entno >= 8192 || chan < 0 || chan > 7)
-    {
-        float idx, sflags;
-        idx = precache_sound_index(SND(Null));
-        sflags = SND_LARGEENTITY;
-        if (idx >= 256)
-            sflags |= SND_LARGESOUND;
-        WriteByte(_dest, SVC_SOUND);
-        WriteByte(_dest, sflags);
-        WriteShort(_dest, entno);
-        WriteByte(_dest, chan);
-        if (sflags & SND_LARGESOUND)
-            WriteShort(_dest, idx);
-        else
-            WriteByte(_dest, idx);
-        WriteCoord(_dest, e.origin.x);
-        WriteCoord(_dest, e.origin.y);
-        WriteCoord(_dest, e.origin.z);
-    }
-    else
-    {
-        WriteByte(_dest, SVC_STOPSOUND);
-        WriteShort(_dest, entno * 8 + chan);
-    }
-}
-void stopsound(entity e, float chan)
-{
-    if (!sound_allowed(MSG_BROADCAST, e))
-        return;
-
-    stopsoundto(MSG_BROADCAST, e, chan); // unreliable, gets there fast
-    stopsoundto(MSG_ALL, e, chan); // in case of packet loss
-}
-
-void play2(entity e, string filename)
-{
-    //stuffcmd(e, strcat("play2 ", filename, "\n"));
-    msg_entity = e;
-    soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
-}
-
-// use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
-.float spamtime;
-float spamsound(entity e, float chan, string samp, float vol, float _atten)
-{
-    if (!sound_allowed(MSG_BROADCAST, e))
-        return false;
-
-    if (time > e.spamtime)
-    {
-        e.spamtime = time;
-        _sound(e, chan, samp, vol, _atten);
-        return true;
-    }
-    return false;
-}
-
-void play2team(float t, string filename)
-{
-    entity head;
-
-    if (autocvar_bot_sound_monopoly)
-        return;
-
-    FOR_EACH_REALPLAYER(head)
-    {
-        if (head.team == t)
-            play2(head, filename);
-    }
-}
-
-void play2all(string samp)
-{
-    if (autocvar_bot_sound_monopoly)
-        return;
-
-    _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
-}
-
 void PrecachePlayerSounds(string f);
 void precache_playermodel(string m)
 {
index ae0aa0e0abfa25f897686a9c2d2b909c7af8dcc2..4193ff29add7c5bd7fd357c9862a3faaa85d0ef3 100644 (file)
@@ -124,32 +124,6 @@ void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomo
 
 #define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
 
-const string STR_PLAYER = "player";
-const string STR_SPECTATOR = "spectator";
-const string STR_OBSERVER = "observer";
-
-#define IS_PLAYER(v)                   ((v).classname == STR_PLAYER)
-#define IS_SPEC(v)                             ((v).classname == STR_SPECTATOR)
-#define IS_OBSERVER(v)                         ((v).classname == STR_OBSERVER)
-#define IS_CLIENT(v)                   (v.flags & FL_CLIENT)
-#define IS_BOT_CLIENT(v)               (clienttype(v) == CLIENTTYPE_BOT)
-#define IS_REAL_CLIENT(v)              (clienttype(v) == CLIENTTYPE_REAL)
-#define IS_NOT_A_CLIENT(v)             (clienttype(v) == CLIENTTYPE_NOTACLIENT)
-
-#define IS_MONSTER(v)                  (v.flags & FL_MONSTER)
-#define IS_VEHICLE(v)                  (v.vehicle_flags & VHF_ISVEHICLE)
-#define IS_TURRET(v)                   (v.turret_flags & TUR_FLAG_ISTURRET)
-
-#define FOR_EACH_CLIENTSLOT(v) for(v = world; (v = nextent(v)) && (num_for_edict(v) <= maxclients); )
-#define FOR_EACH_CLIENT(v) FOR_EACH_CLIENTSLOT(v) if(IS_CLIENT(v))
-#define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(IS_REAL_CLIENT(v))
-
-#define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(IS_PLAYER(v))
-#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (!IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
-#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v))
-
-#define FOR_EACH_MONSTER(v) for(v = world; (v = findflags(v, flags, FL_MONSTER)) != world; )
-
 #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
 
 // copies a string to a tempstring (so one can strunzone it)
@@ -408,17 +382,6 @@ void readlevelcvars()
 
 //#NO AUTOCVARS END
 
-
-// Sound functions
-//string precache_sound (string s) = #19;
-// hack
-float precache_sound_index (string s) = #19;
-
-const float SND_VOLUME = BIT(0);
-const float SND_ATTENUATION = BIT(1);
-const float SND_LARGEENTITY = BIT(3);
-const float SND_LARGESOUND = BIT(4);
-
 const float INITPRIO_FIRST                             = 0;
 const float INITPRIO_GAMETYPE                  = 0;
 const float INITPRIO_GAMETYPE_FALLBACK         = 1;