mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- 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)
This commit is contained in:
parent
5e85f736bb
commit
23cda7c685
1 changed files with 8 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue