From: terencehill Date: Sun, 19 Mar 2017 15:43:56 +0000 (+0100) Subject: Calculate middle point on CTF initialization X-Git-Tag: xonotic-v0.8.2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ce305509747cb5d0d59d7a812004c5c10f5c8495;p=xonotic%2Fxonotic-data.pk3dir.git Calculate middle point on CTF initialization --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 8a88d5d2e..2c571991e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -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