From: Mario Date: Fri, 18 Mar 2016 01:26:02 +0000 (+1000) Subject: Bring back some old hacks to allow taunting while spectating/observing X-Git-Tag: xonotic-v0.8.2~1067 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d2c546578368124439ea8ea2710eb0348aa10e8c;p=xonotic%2Fxonotic-data.pk3dir.git Bring back some old hacks to allow taunting while spectating/observing --- diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index 68edd6f7e..0768a7188 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -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); @@ -59,10 +59,10 @@ */ 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) { @@ -304,7 +304,12 @@ 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); } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index d41cf563a..34800eaff 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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)