]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a random reference to .health and .armorvalue in bot CTF code
authorMario <zacjardine@y7mail.com>
Mon, 10 Sep 2018 15:02:08 +0000 (01:02 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 10 Sep 2018 15:02:08 +0000 (01:02 +1000)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc

index efbbf94e72aceee1716ad7d50f9ad49edc6a66b7..2696a4e87892d4dca5dbc3b688d91f0b4bf85059 100644 (file)
@@ -1519,7 +1519,7 @@ void havocbot_goalrating_ctf_enemyflag(entity this, float ratingscale)
                {
                        // adjust rating of our flag carrier depending on his health
                        head = head.tag_entity;
-                       float f = bound(0, (head.health + head.armorvalue) / 100, 2) - 1;
+                       float f = bound(0, (GetResourceAmount(head, RESOURCE_HEALTH) + GetResourceAmount(head, RESOURCE_ARMOR)) / 100, 2) - 1;
                        ratingscale += ratingscale * f * 0.1;
                }
                navigation_routerating(this, head, ratingscale, 10000);