From: Mircea Kitsune Date: Sun, 10 Apr 2011 15:14:10 +0000 (+0300) Subject: Also don't send the effect to a player if he has the feature disabled, further improv... X-Git-Tag: xonotic-v0.6.0~110^2^2~122 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ee8fd10b209eeb7af02e8ac8e2b51df7c272dbd9;p=xonotic%2Fxonotic-data.pk3dir.git Also don't send the effect to a player if he has the feature disabled, further improving bandwidth. --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index d7179fafe..e430e3e09 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -505,6 +505,8 @@ float GetPlayerSoundSampleField_notFound; .float cvar_cl_voice_directional; .float cvar_cl_voice_directional_taunt_attenuation; +.float cvar_cl_damageeffect; + .float version_mismatch; float independent_players; diff --git a/qcsrc/server/g_violence.qc b/qcsrc/server/g_violence.qc index d1c1982d0..7d4e20b78 100644 --- a/qcsrc/server/g_violence.qc +++ b/qcsrc/server/g_violence.qc @@ -53,7 +53,10 @@ void Violence_GibSplash(entity source, float type, float amount, entity attacker float Violence_DamageEffect_SendEntity(entity to, float sf) { - // if the client cannot see the damaged player, don't send to him and waste bandwidth + // if the client doesn't have the effect enabled, don't send to him and waste bandwidth + if not(to.cvar_cl_damageeffect) + return FALSE; + // if the client cannot see the damaged player, avoid sending and further save bandwidth if not(checkpvs(to.origin + to.view_ofs, self)) return FALSE; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 84dd07d94..0d75fe890 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -602,6 +602,7 @@ void GetCvars(float f) GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete); GetCvars_handleFloat(s, f, cvar_cl_weaponimpulsemode, "cl_weaponimpulsemode"); GetCvars_handleFloat(s, f, cvar_cl_autotaunt, "cl_autotaunt"); + GetCvars_handleFloat(s, f, cvar_cl_damageeffect, "cl_damageeffect"); GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag"); GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional"); GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");