]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/miscfunctions.qc
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / miscfunctions.qc
index fdaaf7da6d5ef03c5ee2aaf1918f80f24ba1fb82..0ba6097701ebe85295efa9179652aa92f42bf0aa 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);
                        }
        }
 }
@@ -319,9 +319,6 @@ vector HUD_GetFontsize(string cvarname)
 
 float PreviewExists(string name)
 {
-       float f;
-       string file;
-
        if(autocvar_cl_readpicture_force)
                return false;
 
@@ -759,10 +756,15 @@ const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way
 vector getplayerorigin(float pl)
 {
        string s;
+       entity e;
+
        s = getplayerkey(pl, "TEMPHACK_origin");
        if(s != "")
                return stov(s);
-       if(entcs_receiver[pl].classname == "entcs_receiver")
-               return entcs_receiver[pl].origin;
+
+       e = entcs_receiver[pl];
+       if(e)
+               return e.origin;
+
        return GETPLAYERORIGIN_ERROR;
 }