]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
get rid of all use of CHAN_AUTO, use CH_ names
authorRudolf Polzer <divverent@xonotic.org>
Sun, 3 Jul 2011 15:22:36 +0000 (17:22 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 3 Jul 2011 15:22:36 +0000 (17:22 +0200)
15 files changed:
qcsrc/client/View.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/ctf.qc
qcsrc/server/domination.qc
qcsrc/server/func_breakable.qc
qcsrc/server/g_triggers.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/nexball.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc

index 823f820441a3623b6f1c98e7c2f7f6fbcda63fb6..dfefe96ff596d400fdeb70d327ab1eb0cfa7e593 100644 (file)
@@ -93,7 +93,7 @@ void CheckForGamestartChange() {
        if (previous_game_starttime != startTime) {
                if ((time + 5.0) < startTime) {
                        //if connecting to server while restart was active don't always play prepareforbattle
-                       sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
+                       sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
                }
                if (time < startTime) {
                        restartAnnouncer = spawn();
@@ -945,13 +945,13 @@ void CSQC_UpdateView(float w, float h)
        hit_time = getstatf(STAT_HIT_TIME);
        if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
        {
-               sound(world, CHAN_AUTO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+               sound(world, CH_INFO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
                nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
        }
        typehit_time = getstatf(STAT_TYPEHIT_TIME);
        if(typehit_time > nextsound_typehit_time)
        {
-               sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+               sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
                nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
        }
 
index a9e7ca4a94beee110d55d8b85d3879fa03132eff..b40dd49ee177da1587efb86372a871ccf2aa025a 100644 (file)
@@ -436,7 +436,7 @@ void MapVote_UpdateMask()
 
        if(oldmask & mv_maps_mask != oldmask)
                if(oldmask & mv_maps_mask == mv_maps_mask)
-                        sound(world, CHAN_AUTO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
+                        sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
 
        // remove votes that no longer apply
        for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
index d59c75ba8d81629cfc485bea7499a6fe32a9a60a..da09230dbc1965cab6b3f3310fe633b4e43f24c2 100644 (file)
@@ -8,7 +8,7 @@ void serverAnnouncer()
        // check for pending announcement, play it and remove it
        if(announce_snd != "")
        {
-               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
                strunzone(announce_snd);
                announce_snd = "";
        }
@@ -22,7 +22,7 @@ void restartAnnouncer_Think() {
                if (!spectatee_status) //do cprint only for players
                        centerprint(_("^1Begin!"));
 
-               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
+               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
                //reset maptime announcers now as well
                announcer_5min = announcer_1min = FALSE;
 
@@ -34,7 +34,7 @@ void restartAnnouncer_Think() {
                        centerprint(sprintf(_("^1Game starts in %d seconds"), countdown_rounded));
 
                if(countdown_rounded <= 3 && countdown_rounded >= 1) {
-                       sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
+                       sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
                }
 
                self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
@@ -71,7 +71,7 @@ void maptimeAnnouncer() {
                        //if we're in warmup mode, check whether there's a warmup timelimit
                        if not (warmuplimit == -1 && warmup_stage) {
                                announcer_5min = TRUE;
-                               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
+                               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
                        }
        }
 
@@ -86,7 +86,7 @@ void maptimeAnnouncer() {
                        //if we're in warmup mode, check whether there's a warmup timelimit
                        if not (warmuplimit == -1 && warmup_stage) {
                                announcer_1min = TRUE;
-                               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
+                               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
                        }
        }
 }
index 82ff65c39e2bd2ee13bcecf801b30841e80d753d..2bd2c0f58684833136a0c5aa7dd82bf5b307b051 100644 (file)
@@ -1987,7 +1987,7 @@ void play_countdown(float finished, string samp)
        if(clienttype(self) == CLIENTTYPE_REAL)
                if(floor(finished - time - frametime) != floor(finished - time))
                        if(finished - time < 6)
-                               sound (self, CHAN_AUTO, samp, VOL_BASE, ATTN_NORM);
+                               sound (self, CH_INFO, samp, VOL_BASE, ATTN_NORM);
 }
 
 /**
index 500132f0bdf26af7e5ddaa8246a17cedcce20d38..7f6265f9027bfdce88fc48d245331f0a80aa1f83 100644 (file)
@@ -255,7 +255,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
                (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
        ) // prevent insane sound spam
        {
-               sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+               sound(ent, CH_ITEMS, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
                ent.prevstrengthsound = time;
        }
        ent.prevstrengthsoundattempt = time;
@@ -1063,7 +1063,7 @@ float weapon_prepareattack_checkammo(float secondary)
 
                if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
                {
-                       sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+                       sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
                        self.prevdryfire = time;
                }
 
index 7edfe9337185601a50019e2b9c6eab592eee2e92..10e7148ec8598d0b8cd47d6d6b09b39dd85ef1df 100644 (file)
@@ -493,7 +493,7 @@ void FlagTouch()
                        }
                }
 
-               sound (other, CHAN_AUTO, self.noise2, VOL_BASE, ATTN_NONE);
+               sound (other, CH_ITEMS, self.noise2, VOL_BASE, ATTN_NONE);
                WaypointSprite_DetachCarrier(other);
                if(self.speedrunning)
                        FakeTimeLimit(other, -1);
@@ -531,7 +531,7 @@ void FlagTouch()
                self.dropperid = other.playerid;
                PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
                LogCTF("steal", self.team, other);
-               sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+               sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
 
                FOR_EACH_PLAYER(player)
                        if(player.team == self.team)
@@ -586,7 +586,7 @@ void FlagTouch()
                        }
                        PlayerScore_Add(other, SP_CTF_RETURNS, 1);
                        LogCTF("return", self.team, other);
-                       sound (other, CHAN_AUTO, self.noise1, VOL_BASE, ATTN_NONE);
+                       sound (other, CH_ITEMS, self.noise1, VOL_BASE, ATTN_NONE);
                        ReturnFlag(self);
                }
                else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
@@ -618,7 +618,7 @@ void FlagTouch()
                        UpdateFrags(other, f);
                        PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
                        LogCTF("pickup", self.team, other);
-                       sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+                       sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
 
                        FOR_EACH_PLAYER(player)
                                if(player.team == self.team)
index 93bd69a1142d176ebfa68acbd1ef6ce399f9a3de..3c13d03508db77c6d1a5a6be751c7bf8b6cf41ac 100644 (file)
@@ -109,9 +109,9 @@ void dompoint_captured ()
 
        if (head.noise != "")
                if(self.enemy)
-                       sound(self.enemy, CHAN_AUTO, head.noise, VOL_BASE, ATTN_NORM);
+                       sound(self.enemy, CH_ITEMS, head.noise, VOL_BASE, ATTN_NORM);
                else
-                       sound(self, CHAN_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+                       sound(self, CH_TRIGGERS_SINGLE, head.noise, VOL_BASE, ATTN_NORM);
        if (head.noise1 != "")
                play2all(head.noise1);
 
index 5a3b098b6a3adb787f5f15a8433c1160da9e72d4..7ab3df7a61bd4e24d13757d9f71a1765ab2caed3 100644 (file)
@@ -162,7 +162,7 @@ void func_breakable_destroy() {
        func_breakable_destroyed();
 
        if(self.noise)
-               sound (self, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+               sound (self, CH_TRIGGERS_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
 
        if(self.dmg)
                RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, self.dmg_force, DEATH_HURTTRIGGER, world);
index 1f3c7f548613cca06e3bee3003e924d9d74994ba..7247352dd6bb9a763a9851d20e5e7380cefea68d 100644 (file)
@@ -171,7 +171,7 @@ void multi_trigger()
        }
 
        if (self.noise)
-               sound (self.enemy, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+               sound (self.enemy, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
 
 // don't trigger again until reset
        self.takedamage = DAMAGE_NO;
@@ -554,7 +554,7 @@ void trigger_heal_touch()
                        {
                                other.health = min(other.health + self.health, self.max_health);
                                other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
-                               sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+                               sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
                        }
                }
        }
@@ -665,7 +665,7 @@ void trigger_gravity_touch()
        {
                other.gravity = g;
                if(self.noise != "")
-                       sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+                       sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
                UpdateCSQCProjectile(self.owner);
        }
 };
index d2aa92ecb393c98bb3102ec1e76218b863a78949..a130049102c0c3be423d73063b2add6bdb30d9b5 100644 (file)
@@ -1464,7 +1464,7 @@ void play2(entity e, string filename)
 {
     //stuffcmd(e, strcat("play2 ", filename, "\n"));
     msg_entity = e;
-    soundtoat(MSG_ONE, world, '0 0 0', CHAN_AUTO, filename, VOL_BASE, ATTN_NONE);
+    soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTN_NONE);
 }
 
 // use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
@@ -1502,7 +1502,7 @@ void play2all(string samp)
     if (autocvar_bot_sound_monopoly)
         return;
 
-    sound(world, CHAN_AUTO, samp, VOL_BASE, ATTN_NONE);
+    sound(world, CH_INFO, samp, VOL_BASE, ATTN_NONE);
 }
 
 void PrecachePlayerSounds(string f);
index e55f979960eab8c4ceb7f2acc0276e013bda7a64..5f006329042da284ac736afa9d8d49b3e8508745 100644 (file)
@@ -78,7 +78,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
                WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
                WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);    
 
-               sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
+               sound(self, CH_TRIGGERS_SINGLE, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
        }
        else
        {
@@ -99,7 +99,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        if(other.classname != "player") 
        {  // The ball just touched an object, most likely the world
                pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
-               sound(self, CHAN_AUTO, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGERS_SINGLE, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
                return; 
        }
        else if(self.wait > time) { return; }
@@ -128,7 +128,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
-       sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
+       sound(self.owner, CH_ITEMS, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
        PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
@@ -170,7 +170,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
-       sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);   // ATTN_NONE (it's a sound intended to be heard anywhere) 
+       sound(plyr, CH_ITEMS, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);     // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
        // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
index 4d76b26954e466cb53a2ffe3b6cd7983cc42756d..515541fc3a4a6724b2a6e983cd4a676ed3f98633 100644 (file)
@@ -413,7 +413,7 @@ void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deatht
 
 void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped key
 {
-       sound(player, CHAN_AUTO, kh_sound_collect, VOL_BASE, ATTN_NORM);
+       sound(player, CH_ITEMS, kh_sound_collect, VOL_BASE, ATTN_NORM);
 
        if(key.kh_dropperteam != player.team)
        {
@@ -664,7 +664,7 @@ void kh_Key_Think()  // runs all the time
        {
                if(self.siren_time < time)
                {
-                       sound(self.owner, CHAN_AUTO, kh_sound_alarm, VOL_BASE, ATTN_NORM);  // play a simple alarm
+                       sound(self.owner, CH_ITEMS, kh_sound_alarm, VOL_BASE, ATTN_NORM);  // play a simple alarm
                        self.siren_time = time + 2.5;  // repeat every 2.5 seconds
                }
 
@@ -799,7 +799,7 @@ void kh_Key_DropOne(entity key)
        key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
        key.kh_dropperteam = key.team;
 
-       sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+       sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
 }
 
 void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
@@ -825,7 +825,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                        if(suicide)
                                key.kh_dropperteam = player.team;
                }
-               sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+               sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
        }
 }
 
index b43333bcda41432ba781e98bd477621654724815..0cbc5743c69389bc9f9aff9302826bfcb5955767 100644 (file)
@@ -366,7 +366,7 @@ void GoalTouch (void)
                pscore = 1;
        }
 
-       sound (ball, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+       sound (ball, CH_TRIGGERS_SINGLE, self.noise, VOL_BASE, ATTN_NONE);
 
        if(ball.team && pscore)
        {
@@ -604,7 +604,7 @@ void W_Nexball_Touch (void)
                if(!attacker.ballcarried)
                {
                        LogNB("stole", attacker);
-                       sound (other, CHAN_AUTO, ball.noise2, VOL_BASE, ATTN_NORM);
+                       sound (other, CH_ITEMS, ball.noise2, VOL_BASE, ATTN_NORM);
 
                        if(attacker.team == other.team && time > attacker.teamkill_complain)
                        {
index 02660fc52a97c8f291f98d4728a92053ae9d563a..c64de548b9aa67dc1280d4e2c34cf4351c94d659 100644 (file)
@@ -447,7 +447,7 @@ float Item_GiveTo(entity item, entity player)
        if (!pickedup)
                return 0;
 
-       sound (player, CHAN_AUTO, item.item_pickupsound, VOL_BASE, ATTN_NORM);
+       sound (player, CH_ITEMS, item.item_pickupsound, VOL_BASE, ATTN_NORM);
        if (_switchweapon)
                if (player.switchweapon != w_getbestweapon(player))
                        W_SwitchWeapon_Force(player, w_getbestweapon(player));
@@ -1532,12 +1532,12 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn
        if(v1 <= v0 - t)
        {
                if(snd_decr != "")
-                       sound (e, CHAN_AUTO, snd_decr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_ITEMS, snd_decr, VOL_BASE, ATTN_NORM);
        }
        else if(v0 >= v0 + t)
        {
                if(snd_incr != "")
-                       sound (e, CHAN_AUTO, snd_incr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_ITEMS, snd_incr, VOL_BASE, ATTN_NORM);
        }
 }
 
index 8da124971f144dd82219e59216d93adfcbaeea4a..d12379d64354faeb935d9dc5ffc5c48be7bb71f4 100644 (file)
@@ -155,7 +155,7 @@ void trigger_push_touch()
                {
                        // flash when activated
                        pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1);
-                       sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+                       sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
                        self.pushltime = time + 0.2;
                }
                local float ct;