]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Proper precaching, plus make the net_announce system ACTUALLY work instead
authorSamual <samual@xonotic.org>
Tue, 18 Oct 2011 06:37:30 +0000 (02:37 -0400)
committerSamual <samual@xonotic.org>
Tue, 18 Oct 2011 06:37:30 +0000 (02:37 -0400)
of some stupid hack :P

qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/announcer.qc

index 4ef1d04d6765a3260f0825bb2e88b875970cb968..b074aa3b2a7fe88f97793188e18ba839b5f93976 100644 (file)
@@ -177,9 +177,6 @@ float               dmg_take;
 float vid_conwidth, vid_conheight;
 float binddb;
 
-//     Announcer
-string announce_snd;
-
 // QUALIFYING
 float race_checkpoint;
 float race_time;
index 21617d1a79d55b0fa755805f59e1c362781460da..81a04caf09fa7faf4db8d0a7ad025142f39b9403 100644 (file)
@@ -42,7 +42,6 @@ float __engine_check;
 #endif
 
 string forcefog;
-string cl_announcer_prev;
 void WaypointSprite_Load();
 void CSQC_Init(void)
 {
@@ -141,13 +140,7 @@ void CSQC_Init(void)
        DamageInfo_Precache();
        Vehicles_Precache();
        turrets_precache();
-
-       if(autocvar_cl_announcer != cl_announcer_prev) {
-               Announcer_Precache();
-               if(cl_announcer_prev)
-                       strunzone(cl_announcer_prev);
-               cl_announcer_prev = strzone(autocvar_cl_announcer);
-       }
+  Announcer_Precache();
        Tuba_Precache();
 
        if(autocvar_cl_reticle_item_normal) precache_pic("gfx/reticle_normal");
@@ -1384,7 +1377,7 @@ float CSQC_Parse_TempEntity()
                        bHandled = true;
                        break;
                case TE_CSQC_ANNOUNCE:
-                       announce_snd = strzone(ReadString());
+                       Net_Announcer(ReadString());
                        bHandled = true;
                        break;
                case TE_CSQC_KILLNOTIFY:
index aa70b736d9f69541034a1a301a24f47775317c93..9b9b37fb6b658f0e99c8ca640c9c7e89fc894ea3 100644 (file)
@@ -490,12 +490,14 @@ void CSQC_UpdateView(float w, float h)
                PostInit();
 
        if(intermission && !isdemo() && !(calledhooks & HOOK_END))
+       {
                if(calledhooks & HOOK_START)
                {
                        localcmd("\ncl_hook_gameend\n");
                        calledhooks |= HOOK_END;
                }
-
+       }
+       
   Announcer();
 
        fov = autocvar_fov;
index 65d7500cae6d65e0fe532bc952aa7e01bc761672..0b404edab76bca094670a693352497dcba828dbc 100644 (file)
@@ -1,12 +1,6 @@
-void serverAnnouncer()
+void Net_Announcer(string announce_snd)
 {
-       // check for pending announcement, play it and remove it
-       if(announce_snd != "")
-       {
-               sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
-               strunzone(announce_snd);
-               announce_snd = "";
-       }
+  sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
 }
 
 /**
@@ -157,7 +151,6 @@ void carrierAnnouncer() {
 void Announcer()
 {
   CheckForGamestartChange();
-       serverAnnouncer();
        maptimeAnnouncer();
        carrierAnnouncer();
 }