]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: as for jumppad waypoint, remove ambiguity from touch check of teleport /...
authorterencehill <piuntn@gmail.com>
Sat, 20 Jan 2018 18:26:42 +0000 (19:26 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 20 Jan 2018 18:26:42 +0000 (19:26 +0100)
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/teleporters.qh
qcsrc/lib/warpzone/server.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/client.qc

index 373b755371f14fc7f3bfa66fc6a56ec006e9791f..5aedf30214ea16f1939743fc021391c9d5df4d46 100644 (file)
@@ -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;
        }
 }
index d7faaeff80bd7d76f6e1595e04d2cfef37dda429..6f5b2b595d8c09a110839cb4aeb3ca3a3ef11f42 100644 (file)
@@ -67,5 +67,4 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl);
 
 #ifdef CSQC
 .entity realowner;
-.float lastteleporttime;
 #endif
index 6db6122352511d9640ac75baf603103a4e96ce65..943ffe3f5330731e4ab14a5667f454bcf4fdd860 100644 (file)
@@ -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
index e491a327dc6754890471f2dbd2a16fe8cbde5565..867d220ba66d014d7d9b35fe2bd09c5d2c23f22c 100644 (file)
@@ -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;
index adfa40aeb6050de44535abf2368ba6dfe901f2ef..14291d2510f7eae5261e65c35545588e3e1882e3 100644 (file)
@@ -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