From dfe470e5f254b2eb60c41bad91fe4cc3b2e9b456 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 2 Jan 2013 03:17:52 +0000 Subject: [PATCH] - Added JLOSF_NOAUTOAIM flag for when you want to use A_JumpIfTargetInLOS in conjunction with something that never autoaims, such as a railgun. - Fixed: A_JumpIfTargetInLOS should use P_AimLineAttack() instead of P_BulletSlope(), because the latter intentionally checks to the sides of the aimed line. SVN r4007 (trunk) --- src/thingdef/thingdef_codeptr.cpp | 5 +++-- wadsrc/static/actors/constants.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 597ba48d4..36efe7e8f 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -2866,7 +2866,8 @@ enum JLOS_flags JLOSF_TARGETLOS=128, JLOSF_FLIPFOV=256, JLOSF_ALLYNOJUMP=512, - JLOSF_COMBATANTONLY=1024 + JLOSF_COMBATANTONLY=1024, + JLOSF_NOAUTOAIM=2048, }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS) @@ -2912,7 +2913,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS) else { // Does the player aim at something that can be shot? - P_BulletSlope(self, &target); + P_AimLineAttack(self, self->angle, MISSILERANGE, &target, (flags & JLOSF_NOAUTOAIM) ? ANGLE_1/2 : 0); if (!target) return; diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 761664308..a8bcf26b8 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -84,6 +84,7 @@ const int JLOSF_TARGETLOS = 128; const int JLOSF_FLIPFOV = 256; const int JLOSF_ALLYNOJUMP = 512; const int JLOSF_COMBATANTONLY = 1024; +const int JLOSF_NOAUTOAIM = 2048; // Flags for A_ChangeVelocity const int CVF_RELATIVE = 1;