]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix stupid bug causing bots to never go for enemy flag after taking the enemy flag...
authorterencehill <piuntn@gmail.com>
Sat, 14 Jan 2017 22:20:59 +0000 (23:20 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 14 Jan 2017 22:20:59 +0000 (23:20 +0100)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 5ee07992fcd379e3e123627ba43ba989c6ba410a..c88639085ec5a47434fe372af8944634d2484e90 100644 (file)
@@ -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);
 }