From: Mario Date: Mon, 10 Sep 2018 15:02:08 +0000 (+1000) Subject: Fix a random reference to .health and .armorvalue in bot CTF code X-Git-Tag: xonotic-v0.8.5~1882 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ae2df6e848cc17ebec51b18fa2427675e39ee996;p=xonotic%2Fxonotic-data.pk3dir.git Fix a random reference to .health and .armorvalue in bot CTF code --- diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index efbbf94e7..2696a4e87 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -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);