diff --git a/src/console/c_functions.cpp b/src/console/c_functions.cpp index 7bbf314cc5..4b9344e6c0 100644 --- a/src/console/c_functions.cpp +++ b/src/console/c_functions.cpp @@ -53,7 +53,7 @@ void C_PrintInfo(AActor *target, bool verbose) void C_AimLine(FTranslatedLineTarget *t, bool nonshootable) { P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->Angles.Yaw, MISSILERANGE, t, 0., - (nonshootable) ? ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART : 0); + (nonshootable) ? ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART|ALF_IGNORENOAUTOAIM : ALF_IGNORENOAUTOAIM); } void C_PrintInv(AActor *target) diff --git a/src/playsim/p_local.h b/src/playsim/p_local.h index ce39c5b77c..ade5b9765c 100644 --- a/src/playsim/p_local.h +++ b/src/playsim/p_local.h @@ -310,6 +310,7 @@ enum // P_AimLineAttack flags ALF_NOFRIENDS = 16, ALF_PORTALRESTRICT = 32, // only work through portals with a global offset (to be used for stuff that cannot remember the calculated FTranslatedLineTarget info) ALF_NOWEAPONCHECK = 64, // ignore NOAUTOAIM flag on a player's weapon. + ALF_IGNORENOAUTOAIM = 128, // for informative stuff like 'linetarget' CCMD. }; enum // P_LineAttack flags diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 5b5905b03a..c2960610c4 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -4192,7 +4192,7 @@ struct aim_t dist = attackrange * in->frac; // Don't autoaim certain special actors - if (!cl_doautoaim && th->flags6 & MF6_NOTAUTOAIMED) + if (!cl_doautoaim && !(flags & ALF_IGNORENOAUTOAIM) && th->flags6 & MF6_NOTAUTOAIMED) { continue; } diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 62e67c1e04..52771f786e 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -6846,6 +6846,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, double x, double y, double z, { return nullptr; } + aimflags &= ~ALF_IGNORENOAUTOAIM; // just to be safe. static const double angdiff[3] = { -5.625, 5.625, 0 }; DAngle an = angle; diff --git a/src/playsim/p_pspr.cpp b/src/playsim/p_pspr.cpp index eb9f351cb2..b9e8655a00 100644 --- a/src/playsim/p_pspr.cpp +++ b/src/playsim/p_pspr.cpp @@ -1198,6 +1198,7 @@ DAngle P_BulletSlope (AActor *mo, FTranslatedLineTarget *pLineTarget, int aimfla DAngle pitch; FTranslatedLineTarget scratch; + aimflags &= ~ALF_IGNORENOAUTOAIM; // just to be safe. if (pLineTarget == NULL) pLineTarget = &scratch; // see which target is to be aimed at i = 2; diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index 34223ff490..a630c6cd8f 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -1150,6 +1150,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckMove, CheckMove) static double AimLineAttack(AActor *self, double angle, double distance, FTranslatedLineTarget *pLineTarget, double vrange, int flags, AActor *target, AActor *friender) { + flags &= ~ALF_IGNORENOAUTOAIM; // just to be safe. This flag is not supposed to be accesible to scripting. return P_AimLineAttack(self, angle, distance, pLineTarget, vrange, flags, target, friender).Degrees; }