From: terencehill Date: Sat, 20 Jan 2018 18:26:42 +0000 (+0100) Subject: Bot AI: as for jumppad waypoint, remove ambiguity from touch check of teleport /... X-Git-Tag: xonotic-v0.8.5~2378^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7a95b7ff1fd707adbdfe729af2da8d61f3bfdb51;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: as for jumppad waypoint, remove ambiguity from touch check of teleport / warpzone waypoints too --- diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 373b75537..5aedf3021 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -165,6 +165,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle } player.lastteleporttime = time; + player.lastteleport_origin = from; } #endif } @@ -310,7 +311,5 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl) #ifdef SVQC pl.oldvelocity = pl.velocity; #endif - // reset teleport time tracking too (or multijump can cause insane speeds) - pl.lastteleporttime = time; } } diff --git a/qcsrc/common/triggers/teleporters.qh b/qcsrc/common/triggers/teleporters.qh index d7faaeff8..6f5b2b595 100644 --- a/qcsrc/common/triggers/teleporters.qh +++ b/qcsrc/common/triggers/teleporters.qh @@ -67,5 +67,4 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl); #ifdef CSQC .entity realowner; -.float lastteleporttime; #endif diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 6db612235..943ffe3f5 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -37,6 +37,8 @@ void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity) { + player.lastteleport_origin = player.origin; + player.lastteleporttime = time; setorigin(player, to); // NOTE: this also aborts the move, when this is called by touch #ifdef SVQC player.oldorigin = to; // for DP's unsticking diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index e491a327d..867d220ba 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1595,7 +1595,7 @@ int navigation_poptouchedgoals(entity this) if(this.lastteleporttime > 0 && time - this.lastteleporttime < ((this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL) ? 2 : 0.15)) { - if (this.jumppadcount && !boxesoverlap(this.goalcurrent.absmin, this.goalcurrent.absmax, + if (!boxesoverlap(this.goalcurrent.absmin, this.goalcurrent.absmax, this.lastteleport_origin + STAT(PL_MIN, this), this.lastteleport_origin + STAT(PL_MAX, this))) { return removed_goals; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index adfa40aeb..14291d251 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -636,7 +636,6 @@ void PutPlayerInServer(entity this) setorigin(this, spot.origin + '0 0 1' * (1 - this.mins.z - 24)); // don't reset back to last position, even if new position is stuck in solid this.oldorigin = this.origin; - this.lastteleporttime = time; // prevent insane speeds due to changing origin if(this.conveyor) IL_REMOVE(g_conveyed, this); this.conveyor = NULL; // prevent conveyors at the previous location from moving a freshly spawned player