]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't update health value in the bar above players after the game ends, as it's set...
authorterencehill <piuntn@gmail.com>
Thu, 21 Jan 2021 12:47:53 +0000 (13:47 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 21 Jan 2021 12:47:53 +0000 (13:47 +0100)
qcsrc/common/ent_cs.qc

index 7d8442140ed22d2908dbb490a9055c659ef36459..777bd417a6d2607a0e252dc3bbc3933b4b9b0462 100644 (file)
@@ -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
        }