]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/cursormode
authorterencehill <piuntn@gmail.com>
Wed, 9 Nov 2011 23:35:06 +0000 (00:35 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 9 Nov 2011 23:35:06 +0000 (00:35 +0100)
1  2 
qcsrc/client/Main.qc
qcsrc/client/View.qc

diff --combined qcsrc/client/Main.qc
index 3de6fdd4f9fe3e111568ba3988d4f8b8ab01c444,326bae22b5118a7be4a9566ae83dda022167560a..2f7eb3d62d1509a76ed4cc771a3b114635bafeba
@@@ -42,7 -42,6 +42,6 @@@ float __engine_check
  #endif
  
  string forcefog;
- string cl_announcer_prev;
  void WaypointSprite_Load();
  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)
@@@ -636,10 -629,9 +629,10 @@@ void GameCommand(string msg
  // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
  // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
  // All keys are in ascii.
 -// bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
 +// bInputType = 0 is key pressed, 1 is key released, 2 and 3 are mouse input.
  // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
  // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
 +// In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos.
  float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
  {
        float bSkipKey;
@@@ -1393,7 -1385,7 +1386,7 @@@ float CSQC_Parse_TempEntity(
                        bHandled = true;
                        break;
                case TE_CSQC_ANNOUNCE:
-                       announce_snd = strzone(ReadString());
+                       Announcer_Play(ReadString());
                        bHandled = true;
                        break;
                case TE_CSQC_KILLNOTIFY:
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
-         case TE_CSQC_VEHICLESETUP:
-             Net_VehicleSetup();
-             bHandled = true;
-             break;
+               case TE_CSQC_VEHICLESETUP:
+                       Net_VehicleSetup();
+                       bHandled = true;
+                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
diff --combined qcsrc/client/View.qc
index e0180a70670180a3439179a7516fbbcb5733b721,2d79f8f1045b4c181694d9e76f946e546680eb8f..b64fe3660946dbdead13ac4d1f0a7289feba20d6
@@@ -78,30 -78,6 +78,6 @@@ void Porto_Draw(
        }
  }
  
- /**
-  * Checks whether the server initiated a map restart (stat_game_starttime changed)
-  *
-  * TODO: Use a better solution where a common shared entitiy is used that contains
-  * timelimit, fraglimit and game_starttime! Requires engine changes (remove STAT_TIMELIMIT
-  * and STAT_FRAGLIMIT to be auto-sent)
-  */
- void CheckForGamestartChange() {
-       float startTime;
-       startTime = getstatf(STAT_GAMESTARTTIME);
-       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, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
-               }
-               if (time < startTime) {
-                       restartAnnouncer = spawn();
-                       restartAnnouncer.think = restartAnnouncer_Think;
-                       restartAnnouncer.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
-               }
-       }
-       previous_game_starttime = startTime;
- }
  void Porto_Init()
  {
        porto = spawn();
@@@ -410,6 -386,7 +386,7 @@@ void CSQC_UpdateView(float w, float h
        CHECKFAIL_ASSERT(3, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0);
        CHECKFAIL_ASSERT(4, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{108}\{105}\{103}\{104}\{116}", 0);
        CHECKFAIL_ASSERT(5, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{115}\{104}\{97}\{100}\{111}\{119}\{118}\{111}\{108}\{117}\{109}\{101}\{115}", 0);
+       CHECKFAIL_ASSERT(6, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0);
  
        vf_size = R_SetView3fv(VF_SIZE);
        vf_min = R_SetView3fv(VF_MIN);
        }
        
        // do lockview after event chase camera so that it still applies whenever necessary.
 -      if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0) || intermission > 1)
 +      if(autocvar_cl_lockview || intermission > 1)
        {
                R_SetView(VF_ORIGIN, freeze_org);
                R_SetView(VF_ANGLES, freeze_ang);
                PostInit();
  
        if(intermission && !isdemo() && !(calledhooks & HOOK_END))
+       {
                if(calledhooks & HOOK_START)
                {
                        localcmd("\ncl_hook_gameend\n");
                        calledhooks |= HOOK_END;
                }
-       CheckForGamestartChange();
-       serverAnnouncer();
-       maptimeAnnouncer();
-       carrierAnnouncer();
+       }
+       
+   Announcer();
  
        fov = autocvar_fov;
        if(fov <= 59.5)