]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
do what the original fix was SUPPOSED to be (prevents players from hiding from rocket...
authorRudolf Polzer <divVerent@xonotic.org>
Mon, 22 Aug 2011 13:31:49 +0000 (15:31 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Mon, 22 Aug 2011 13:31:49 +0000 (15:31 +0200)
qcsrc/warpzonelib/server.qc

index ac4a603fe3e4e9c7810cf8f85cf033bdd15c21ad..63e3e712ab84fade91945a62dc4bcd1ff0b63c9f 100644 (file)
@@ -166,8 +166,20 @@ void WarpZone_Touch (void)
                return;
 
        float f;
+       // number of frames we need to go back:
+       //   dist = 16*sqrt(2) qu
+       //   dist ~ 24 qu
+       //   24 qu = v*t
+       //   24 qu = v*frametime*n
+       //       n = 24 qu/(v*frametime)
+       // for clients go only one frame though, may be too irritating otherwise
+       // but max 0.25 sec = 0.25/frametime frames
+       //       24/(0.25/frametime)
+       //       96*frametime
+       float d;
+       d = 24 + max(vlen(other.mins), vlen(other.maxs));
        if(clienttype(other) == CLIENTTYPE_NOTACLIENT)
-               f = min(-1, -64 / vlen(other.velocity));
+               f = -d / bound(frametime * d * 1, frametime * vlen(other.velocity), d);
        else
                f = -1;
        if(WarpZone_Teleport(self, other, f, 0))