]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Calculate middle point on CTF initialization
authorterencehill <piuntn@gmail.com>
Sun, 19 Mar 2017 15:43:56 +0000 (16:43 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 19 Mar 2017 15:43:56 +0000 (16:43 +0100)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 8a88d5d2e8d7ac60ab0b4bd45601914650fb14ba..2c571991e7ddeb025395edd372bcb8e042b539c1 100644 (file)
@@ -1375,7 +1375,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e
 
 // NOTE: LEGACY CODE, needs to be re-written!
 
-void havocbot_calculate_middlepoint()
+void havocbot_ctf_calculate_middlepoint()
 {
        entity f;
        vector s = '0 0 0';
@@ -1602,9 +1602,6 @@ void havocbot_ctf_reset_role(entity this)
        if(IS_DEAD(this))
                return;
 
-       if(havocbot_ctf_middlepoint == '0 0 0')
-               havocbot_calculate_middlepoint();
-
        // Check ctf flags
        if (this.flagcarried)
        {
@@ -2722,6 +2719,8 @@ void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait f
                if(tmp_entity.team == 0) { ctf_oneflag = true; }
        }
 
+       havocbot_ctf_calculate_middlepoint();
+
        if(NumTeams(ctf_teams) < 2) // somehow, there's not enough flags!
        {
                ctf_teams = 0; // so set the default red and blue teams