From 23cda7c68523d25fcad6f3e682bc7c75c160c1ec Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 1 Apr 2012 03:41:08 +0000 Subject: [PATCH] - Do the P_SightCheck() last in A_JumpIfInTargetLOS, since it's the most expensive check. - Fixed: A_JumpIfInTargetLOS did the FOV cone check from self -> target rather than from target -> self. SVN r3503 (trunk) --- src/thingdef/thingdef_codeptr.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 04d54bde1..d60e131f4 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -2887,7 +2887,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS) if (an > (fov / 2) && an < (ANGLE_MAX - (fov / 2))) { - return; // [KS] Outside of FOV - return } @@ -2957,24 +2956,23 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetLOS) doCheckSight = false; } - if (doCheckSight && !P_CheckSight (target, self, SF_IGNOREVISIBILITY)) - return; - if (fov && (fov < ANGLE_MAX)) { - an = R_PointToAngle2 (self->x, - self->y, - target->x, - target->y) - - self->angle; + an = R_PointToAngle2 (target->x, + target->y, + self->x, + self->y) + - target->angle; if (an > (fov / 2) && an < (ANGLE_MAX - (fov / 2))) { return; // [KS] Outside of FOV - return } - } + if (doCheckSight && !P_CheckSight (target, self, SF_IGNOREVISIBILITY)) + return; + ACTION_JUMP(jump); }