]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
document spectatee_status, disable 2d dmgtext for observers 477/head
authorMartin Taibr <taibr.martin@gmail.com>
Mon, 28 Aug 2017 23:26:00 +0000 (01:26 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Mon, 28 Aug 2017 23:26:00 +0000 (01:26 +0200)
qcsrc/client/defs.qh
qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc

index d36994ec3d2e69bbc6849d82eaf3272686c01949..9a5335eff06b7c4ca56a73b17d3324b2a2b9618e 100644 (file)
@@ -74,6 +74,9 @@ float race_myrank;
 float nb_pb_period;
 
 // Spectating
+// -1 - observing
+// 0 - playing
+// >0 - id of spectated player
 float spectatee_status;
 
 // short mapname
index 53042b8ef2779199c1a8412c138eacc2ab9c59bf..bafe8c460733dae6c492706f8a8b6eb0fb405567 100644 (file)
@@ -232,7 +232,11 @@ NET_HANDLE(damagetext, bool isNew)
             }
         }
         make_impure(NEW(DamageText, server_entity_index, entcs.origin, false, health, armor, potential_damage, deathtype, friendlyfire));
-    } else if (autocvar_cl_damagetext_2d) {
+    } else if (autocvar_cl_damagetext_2d && spectatee_status != -1) {
+        // never show 2d damagetext when observing
+        // on some maps (hearth_v2, The_Yard), sometimes has_origin is false even though observers should know about all players
+        // it happens mostly with bots but occasionally also with players
+
         // screen coords only
         vector screen_pos = vec2(vid_conwidth * autocvar_cl_damagetext_2d_pos.x, vid_conheight * autocvar_cl_damagetext_2d_pos.y);
         IL_EACH(g_drawables_2d, it.instanceOfDamageText && it.m_screen_coords && it.m_group == server_entity_index, {