]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Also don't send the effect to a player if he has the feature disabled, further improv...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Apr 2011 15:14:10 +0000 (18:14 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Apr 2011 15:14:10 +0000 (18:14 +0300)
qcsrc/server/defs.qh
qcsrc/server/g_violence.qc
qcsrc/server/miscfunctions.qc

index d7179fafebb703f9c8b2d38ebd426d25cb2a3014..e430e3e0909612a4f785fa7669f1befd279adbc8 100644 (file)
@@ -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;
index d1c1982d0341987a24acc15d00e4c61ba6063b39..7d4e20b78a433e7e7255fb4ece49136155f47377 100644 (file)
@@ -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;
 
index 84dd07d94a185f3c065296f49cc3e2af6b79a017..0d75fe890151c6713a892b6230c7a02cd150438c 100644 (file)
@@ -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");