*/
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);
}
precache_model(modelname);
_setmodel(e, modelname);
player_setupanimsformodel();
+ if(!autocvar_g_debug_globalsounds)
+ UpdatePlayerSounds(e);
}
void FixPlayermodel(entity player);
}
// 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';
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)