X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator%2Fgamemode_race.qc;h=690d23ca8bc3e2595df612f403185eba0975ee9c;hp=2f581d8c433af0c6b8047e71ab7571825eb7ceba;hb=13e8382b4bd9c0de8bcfd2a96f56e638ba5d431d;hpb=04692f3bf447ec38a1bbb0a330c288bbe7a42726 diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index 2f581d8c43..690d23ca8b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -14,24 +14,33 @@ void havocbot_role_race(entity this) if(IS_DEAD(this)) return; - if (this.bot_strategytime < time) + if (navigation_goalrating_timeout(this)) { - this.bot_strategytime = time + autocvar_bot_ai_strategyinterval; navigation_goalrating_start(this); + bool raw_touch_check = true; + int cp = this.race_checkpoint; + + LABEL(search_racecheckpoints) IL_EACH(g_racecheckpoints, true, { - if(it.cnt == this.race_checkpoint) - { - navigation_routerating(this, it, 1000000, 5000); - } - else if(this.race_checkpoint == -1) + if(it.cnt == cp || cp == -1) { + // redirect bot to next goal if it touched the waypoint of an untouchable checkpoint + // e.g. checkpoint in front of Stormkeep's warpzone + // the same workaround is applied in CTS game mode + if (raw_touch_check && vdist(this.origin - it.nearestwaypoint.origin, <, 30)) + { + cp = race_NextCheckpoint(cp); + raw_touch_check = false; + goto search_racecheckpoints; + } navigation_routerating(this, it, 1000000, 5000); - } }); navigation_goalrating_end(this); + + navigation_goalrating_timeout_set(this); } }