]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bring back some old hacks to allow taunting while spectating/observing
authorMario <mario@smbclan.net>
Fri, 18 Mar 2016 01:26:02 +0000 (11:26 +1000)
committerMario <mario@smbclan.net>
Fri, 18 Mar 2016 01:26:19 +0000 (11:26 +1000)
qcsrc/common/effects/qc/globalsound.qc
qcsrc/server/cl_client.qc

index 68edd6f7ed2441ca80267fc77db862556277de13..0768a71883a7f60aa1ac89a5e0c2086d15e5794e 100644 (file)
@@ -24,7 +24,7 @@
                 */
                void globalsound(int channel, entity from, entity gs, float r, int chan, float _vol, float _atten)
                {
-                       assert(IS_PLAYER(from), eprint(from));
+                       //assert(IS_PLAYER(from), eprint(from));
                        if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
                        if (!autocvar_g_debug_globalsounds) {
                                string sample = GlobalSound_sample(gs.m_globalsoundstr, r);
                */
                void playersound(int channel, entity from, entity ps, float r, int chan, float _vol, float _atten)
                {
-                       assert(IS_PLAYER(from), eprint(from));
+                       //assert(IS_PLAYER(from), eprint(from));
                        if (channel == MSG_ONE && !IS_REAL_CLIENT(msg_entity)) return;
                        if (!autocvar_g_debug_globalsounds) {
-                               UpdatePlayerSounds(from);
+                               //UpdatePlayerSounds(from);
                                string s = from.(ps.m_playersoundfld);
                                string sample = GlobalSound_sample(s, r);
                                switch (channel) {
                        this.skin_for_playersound = this.skin;
                        ClearPlayerSounds(this);
                        LoadPlayerSounds(this, "sound/player/default.sounds", true);
-                       if (this.model == "null" || autocvar_g_debug_defaultsounds) return;
+                       if (this.model == "null"
+                       #ifdef SVQC
+                           && autocvar_g_debug_globalsounds
+                       #endif
+                        ) return;
+                       if (autocvar_g_debug_defaultsounds) return;
                        if (LoadPlayerSounds(this, get_model_datafilename(this.model, this.skin, "sounds"), false)) return;
                        LoadPlayerSounds(this, get_model_datafilename(this.model, 0, "sounds"), true);
                }
index d41cf563a85d9c4865109cfe3965982fbb96c001..34800eafff68fbbe54d08bdfe8f267a61d48a2ca 100644 (file)
@@ -160,6 +160,8 @@ void setplayermodel(entity e, string modelname)
        precache_model(modelname);
        _setmodel(e, modelname);
        player_setupanimsformodel();
+       if(!autocvar_g_debug_globalsounds)
+               UpdatePlayerSounds(e);
 }
 
 void FixPlayermodel(entity player);
@@ -192,6 +194,12 @@ void PutObserverInServer()
         }
         // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
         // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
+        if(!autocvar_g_debug_globalsounds)
+        {
+               // needed for player sounds
+               this.model = "";
+               FixPlayermodel(this);
+        } 
         setmodel(this, MDL_Null);
         setsize(this, STAT(PL_CROUCH_MIN, NULL), STAT(PL_CROUCH_MAX, NULL));
         this.view_ofs = '0 0 0';
@@ -382,6 +390,8 @@ void FixPlayermodel(entity player)
        if(chmdl || oldskin != player.skin) // model or skin has changed
        {
                player.species = player_getspecies(player); // update species
+               if(!autocvar_g_debug_globalsounds)
+                       UpdatePlayerSounds(player); // update skin sounds
        }
 
        if(!teamplay)