]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2530 "Observer camera in 3rd person mode with spectate through walls enabled...
authorterencehill <piuntn@gmail.com>
Mon, 22 Mar 2021 16:17:26 +0000 (17:17 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 22 Mar 2021 16:17:26 +0000 (17:17 +0100)
qcsrc/lib/csqcmodel/cl_player.qc

index 69c206133f4b4e71b20e0e460b1c6484ce474a5f..5b35bfa4ef2e781817a1b71a9ab11cbc4dfb8ead 100644 (file)
@@ -486,7 +486,16 @@ vector CSQCPlayer_ApplyChase(entity this, vector v)
                chase_dest.x = v.x + forward.x * cdist;
                chase_dest.y = v.y + forward.y * cdist;
                chase_dest.z = v.z + forward.z * cdist + autocvar_chase_up;
-               traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
+               if (this.move_movetype == MOVETYPE_NOCLIP)
+               {
+                       // as if traceline hasn't hit anything
+                       trace_endpos = chase_dest;
+                       trace_plane_normal = '0 0 0';
+               }
+               else
+               {
+                       traceline(v, chase_dest, MOVE_NOMONSTERS, NULL);
+               }
                v.x = 1 * trace_endpos.x + 8 * forward.x + 4 * trace_plane_normal.x;
                v.y = 1 * trace_endpos.y + 8 * forward.y + 4 * trace_plane_normal.y;
                v.z = 1 * trace_endpos.z + 8 * forward.z + 4 * trace_plane_normal.z;