]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
don't reuse existing damage text when it's barely visible
authorMartin Taibr <taibr.martin@gmail.com>
Tue, 13 Sep 2016 20:22:59 +0000 (22:22 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Tue, 13 Sep 2016 20:22:59 +0000 (22:22 +0200)
qcsrc/common/mutators/mutator/damagetext/damagetext.qc

index a425482e68a10f4e20b7c0b7e4b734df8f2075e9..b3f636a1f2ae41ce6ab900613f40b19ae265d3b9 100644 (file)
@@ -20,6 +20,7 @@ AUTOCVAR_SAVE(cl_damagetext_alpha_lifetime,     float,  3,          "Damage text
 AUTOCVAR_SAVE(cl_damagetext_velocity,           vector, '0 0 20',   "Damage text move direction");
 AUTOCVAR_SAVE(cl_damagetext_offset,             vector, '0 -40 0',  "Damage text offset");
 AUTOCVAR_SAVE(cl_damagetext_accumulate_range,   float,  30,         "Damage text spawned within this range is accumulated");
+AUTOCVAR_SAVE(cl_damagetext_accumulate_alpha,   float,  0.65,       "Only update existing damage text when it's above this much alpha");
 AUTOCVAR_SAVE(cl_damagetext_friendlyfire,       bool,   true,       "Show damage text for friendlyfire too");
 AUTOCVAR_SAVE(cl_damagetext_friendlyfire_color, vector, '1 0 0',    "Damage text color for friendlyfire");
 #endif
@@ -156,7 +157,7 @@ NET_HANDLE(damagetext, bool isNew)
         }
         if (autocvar_cl_damagetext_accumulate_range) {
             for (entity e = findradius(location, autocvar_cl_damagetext_accumulate_range); e; e = e.chain) {
-                if (e.instanceOfDamageText && e.m_group == group) {
+                if (e.instanceOfDamageText && e.m_group == group && e.alpha > autocvar_cl_damagetext_accumulate_alpha) {
                     DamageText_update(e, location, e.m_damage + health, e.m_armordamage + armor, deathtype);
                     return;
                 }