From b73c6e847a4911fda99dd8be663e0f23f0270ec3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 15 Apr 2016 18:46:31 +0200 Subject: [PATCH] - fixed: A_CheckRange calculated the square twice, resulting in a far too large value that got checked. --- src/thingdef/thingdef_codeptr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 53685c43b..03f011b41 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3120,7 +3120,7 @@ static bool DoCheckSightOrRange(AActor *self, AActor *camera, double range, bool dz = 0; } double distance = DVector3(pos, twodi? 0. : dz).LengthSquared(); - if (distance <= range*range) + if (distance <= range) { // Within range return true;