From: Martin Taibr Date: Mon, 28 Aug 2017 23:26:00 +0000 (+0200) Subject: document spectatee_status, disable 2d dmgtext for observers X-Git-Tag: xonotic-v0.8.5~2490^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c334d308aa7ddac4de4b66f4dadc9128e54d94fb;p=xonotic%2Fxonotic-data.pk3dir.git document spectatee_status, disable 2d dmgtext for observers --- diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index d36994ec3..9a5335eff 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -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 diff --git a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc index 53042b8ef..bafe8c460 100644 --- a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc @@ -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, {