From 6cf8d564903730469971f6e7dbc37cc5d84f6a7a Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 21 Jan 2021 13:47:53 +0100 Subject: [PATCH] Don't update health value in the bar above players after the game ends, as it's set to special values --- qcsrc/common/ent_cs.qc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 7d8442140..777bd417a 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -21,13 +21,13 @@ STATIC_INIT(EntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i); } // these entcs_props ids need to be referenced directly int ENTCS_PROP_ENTNUM_id = 0; int ENTCS_PROP_ORIGIN_id = 0; +int ENTCS_PROP_HEALTH_id = 0; STATIC_INIT(EntCSProps_setglobalids) { FOREACH(EntCSProps, true, { - if (it.registered_id == "ENTCS_PROP_ENTNUM") - ENTCS_PROP_ENTNUM_id = it.m_id; - if (it.registered_id == "ENTCS_PROP_ORIGIN") - ENTCS_PROP_ORIGIN_id = it.m_id; + if (it.registered_id == "ENTCS_PROP_ENTNUM") ENTCS_PROP_ENTNUM_id = it.m_id; + if (it.registered_id == "ENTCS_PROP_ORIGIN") ENTCS_PROP_ORIGIN_id = it.m_id; + if (it.registered_id == "ENTCS_PROP_HEALTH") ENTCS_PROP_HEALTH_id = it.m_id; }); } @@ -211,6 +211,11 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL, it.m_set(this, player); this.SendFlags |= BIT(it.m_id); }); + if (intermission_running) + { + // health is set to special values after the game ends, ignore any change + this.SendFlags &= ~BIT(ENTCS_PROP_HEALTH_id); + } setorigin(this, this.origin); // relink } -- 2.39.2