From: terencehill Date: Sat, 14 Jan 2017 22:20:59 +0000 (+0100) Subject: Fix stupid bug causing bots to never go for enemy flag after taking the enemy flag... X-Git-Tag: xonotic-v0.8.2~290 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a516b63ba0b983fa15a809d934ad3e45485ba2a3;p=xonotic%2Fxonotic-data.pk3dir.git Fix stupid bug causing bots to never go for enemy flag after taking the enemy flag for the first time --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 5ee07992f..c88639085 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -1357,7 +1357,7 @@ void havocbot_calculate_middlepoint() entity f; vector s = '0 0 0'; vector fo = '0 0 0'; - float n = 0; + int n = 0; f = ctf_worldflaglist; while (f) @@ -1365,11 +1365,12 @@ void havocbot_calculate_middlepoint() fo = f.origin; s = s + fo; f = f.ctf_worldflagnext; + n++; } if(!n) return; - havocbot_ctf_middlepoint = s * (1.0 / n); - havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint); + havocbot_ctf_middlepoint = s / n; + havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint); }