From 1c0ef1d367f99941181b3e585445e6f9d4d12d4e Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Tue, 26 Jan 2016 10:00:20 -0600 Subject: [PATCH] Removed CPXF_NODISTANCE. --- src/thingdef/thingdef_codeptr.cpp | 8 +++----- wadsrc/static/actors/constants.txt | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 37f228eb1..4349c4b39 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -5968,8 +5968,7 @@ enum CPXFflags CPXF_FARTHEST = 1 << 9, CPXF_CLOSEST = 1 << 10, CPXF_SETONPTR = 1 << 11, - CPXF_NODISTANCE = 1 << 12, - CPXF_CHECKSIGHT = 1 << 13, + CPXF_CHECKSIGHT = 1 << 12, }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity) { @@ -5991,12 +5990,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity) AActor *ref = COPY_AAPTR(self, ptr); //We need these to check out. - if (!ref || !classname || ((distance <= 0) && !(flags & CPXF_NODISTANCE))) + if (!ref || !classname || (distance <= 0)) return; int counter = 0; bool result = false; - if (flags & CPXF_NODISTANCE) distance = (FIXED_MAX/2); fixed_t closer = distance, farther = 0, current = distance; const bool ptrWillChange = !!(flags & (CPXF_SETTARGET | CPXF_SETMASTER | CPXF_SETTRACER)); const bool ptrDistPref = !!(flags & (CPXF_CLOSEST | CPXF_FARTHEST)); @@ -6024,7 +6022,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity) //[MC]Make sure it's in range and respect the desire for Z or not. The function forces it to use //Z later for ensuring CLOSEST and FARTHEST flags are respected perfectly. //Ripped from sphere checking in A_RadiusGive (along with a number of things). - if ((flags & CPXF_NODISTANCE) || (ref->AproxDistance(mo) < distance && + if ((ref->AproxDistance(mo) < distance && ((flags & CPXF_NOZ) || ((ref->Z() > mo->Z() && ref->Z() - mo->Top() < distance) || (ref->Z() <= mo->Z() && mo->Z() - ref->Top() < distance))))) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 090a1330d..23694fda7 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -504,8 +504,7 @@ enum CPXF_FARTHEST = 1 << 9, CPXF_CLOSEST = 1 << 10, CPXF_SETONPTR = 1 << 11, - CPXF_NODISTANCE = 1 << 12, - CPXF_CHECKSIGHT = 1 << 13, + CPXF_CHECKSIGHT = 1 << 12, }; // Flags for A_CheckBlock