From 11e752a9ed6686e021c8810c9ee1eeaf53524f7b Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 13 Oct 2018 16:58:59 +0200 Subject: [PATCH] Bot waypoints: don't create waypoints for jumppads that can be used only by a specific team because bots can't tell them from normal ones (e.g. 2 jumppads on newtonian-nightmare) --- qcsrc/common/mapobjects/trigger/jumppads.qc | 39 ++++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index ca1faeaf9..a61935eb8 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -360,6 +360,10 @@ bool trigger_push_test(entity this, entity item) if(t.move_movetype != MOVETYPE_NONE) continue; + // bots can't tell teamed jumppads from normal ones + if (this.team) + continue; + entity e = spawn(); setsize(e, PL_MIN_CONST, PL_MAX_CONST); e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP; @@ -466,32 +470,41 @@ bool trigger_push_test(entity this, entity item) else if(n == 1) { // exactly one dest - bots love that - this.enemy = find(NULL, targetname, this.target); + if (!this.team) + this.enemy = find(NULL, targetname, this.target); + else // bots can't tell teamed jumppads from normal ones + this.enemy = NULL; } else { // have to use random selection every single time this.enemy = NULL; } + } #ifdef SVQC else { - entity e = spawn(); - setsize(e, PL_MIN_CONST, PL_MAX_CONST); - e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP; - setorigin(e, org); - e.velocity = this.movedir; - tracetoss(e, e); - if (item) + if (!this.team) { - bool r = (trace_ent == item); + entity e = spawn(); + setsize(e, PL_MIN_CONST, PL_MAX_CONST); + e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP; + setorigin(e, org); + e.velocity = this.movedir; + tracetoss(e, e); + if (item) + { + bool r = (trace_ent == item); + delete(e); + return r; + } + if (!(boxesoverlap(this.absmin, this.absmax + eZ * 50, trace_endpos + PL_MIN_CONST, trace_endpos + PL_MAX_CONST))) + waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity), e); delete(e); - return r; } - if (!(boxesoverlap(this.absmin, this.absmax + eZ * 50, trace_endpos + PL_MIN_CONST, trace_endpos + PL_MAX_CONST))) - waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity), e); - delete(e); + else if (item) + return false; } defer(this, 0.1, trigger_push_updatelink); -- 2.39.2