From 37f43617d95e0a2481986cb278b08ec2758bd62f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Apr 2016 11:35:05 +0200 Subject: [PATCH] - make distance check 3D and use proper viewpoint. --- src/gl/scene/gl_bsp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index d72dfae86c..cc8c364b2c 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -342,7 +342,7 @@ static inline void RenderThings(subsector_t * sub, sector_t * sector) FIntCVar *cvar = thing->GetClass()->distancecheck; if (cvar != NULL && *cvar >= 0) { - double dist = thing->Distance2DSquared(camera); + double dist = (thing->PosRelative(viewsector) - ViewPos).LengthSquared(); double check = (double)**cvar; if (dist >= check * check) {