Removed CPXF_NODISTANCE.

This commit is contained in:
MajorCooke 2016-01-26 10:00:20 -06:00
parent ced35e98fb
commit 1c0ef1d367
2 changed files with 4 additions and 7 deletions

View file

@ -5968,8 +5968,7 @@ enum CPXFflags
CPXF_FARTHEST = 1 << 9, CPXF_FARTHEST = 1 << 9,
CPXF_CLOSEST = 1 << 10, CPXF_CLOSEST = 1 << 10,
CPXF_SETONPTR = 1 << 11, CPXF_SETONPTR = 1 << 11,
CPXF_NODISTANCE = 1 << 12, CPXF_CHECKSIGHT = 1 << 12,
CPXF_CHECKSIGHT = 1 << 13,
}; };
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity)
{ {
@ -5991,12 +5990,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity)
AActor *ref = COPY_AAPTR(self, ptr); AActor *ref = COPY_AAPTR(self, ptr);
//We need these to check out. //We need these to check out.
if (!ref || !classname || ((distance <= 0) && !(flags & CPXF_NODISTANCE))) if (!ref || !classname || (distance <= 0))
return; return;
int counter = 0; int counter = 0;
bool result = false; bool result = false;
if (flags & CPXF_NODISTANCE) distance = (FIXED_MAX/2);
fixed_t closer = distance, farther = 0, current = distance; fixed_t closer = distance, farther = 0, current = distance;
const bool ptrWillChange = !!(flags & (CPXF_SETTARGET | CPXF_SETMASTER | CPXF_SETTRACER)); const bool ptrWillChange = !!(flags & (CPXF_SETTARGET | CPXF_SETMASTER | CPXF_SETTRACER));
const bool ptrDistPref = !!(flags & (CPXF_CLOSEST | CPXF_FARTHEST)); 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 //[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. //Z later for ensuring CLOSEST and FARTHEST flags are respected perfectly.
//Ripped from sphere checking in A_RadiusGive (along with a number of things). //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) || ((flags & CPXF_NOZ) ||
((ref->Z() > mo->Z() && ref->Z() - mo->Top() < distance) || ((ref->Z() > mo->Z() && ref->Z() - mo->Top() < distance) ||
(ref->Z() <= mo->Z() && mo->Z() - ref->Top() < distance))))) (ref->Z() <= mo->Z() && mo->Z() - ref->Top() < distance)))))

View file

@ -504,8 +504,7 @@ enum
CPXF_FARTHEST = 1 << 9, CPXF_FARTHEST = 1 << 9,
CPXF_CLOSEST = 1 << 10, CPXF_CLOSEST = 1 << 10,
CPXF_SETONPTR = 1 << 11, CPXF_SETONPTR = 1 << 11,
CPXF_NODISTANCE = 1 << 12, CPXF_CHECKSIGHT = 1 << 12,
CPXF_CHECKSIGHT = 1 << 13,
}; };
// Flags for A_CheckBlock // Flags for A_CheckBlock