diff --git a/src/actor.h b/src/actor.h index 939160ee06..1fd0bce161 100644 --- a/src/actor.h +++ b/src/actor.h @@ -331,6 +331,7 @@ enum MF6_POISONALWAYS = 0x04000000, // Always apply poison, even when target can't take the damage. MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles. MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove + MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index a178b5aab7..8cbe145e26 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -60,6 +60,7 @@ CVAR (Bool, cl_bloodsplats, true, CVAR_ARCHIVE) CVAR (Int, sv_smartaim, 0, CVAR_ARCHIVE|CVAR_SERVERINFO) +CVAR (Bool, cl_doautoaim, false, CVAR_ARCHIVE) static void CheckForPushSpecial (line_t *line, int side, AActor *mobj, bool windowcheck); static void SpawnShootDecal (AActor *t1, const FTraceResults &trace); @@ -3088,6 +3089,12 @@ void aim_t::AimTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_t e } dist = FixedMul (attackrange, in->frac); + // Don't autoaim certain special actors + if (!cl_doautoaim && th->flags6 & MF6_NOTAUTOAIMED) + { + continue; + } + #ifdef _3DFLOORS // we must do one last check whether the trace has crossed a 3D floor if (lastsector==th->Sector && th->Sector->e->XFloor.ffloors.Size()) diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index f82b453741..bafa0fa8b9 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -233,6 +233,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, DONTCORPSE, AActor, flags6), DEFINE_FLAG(MF6, DOHARMSPECIES, AActor, flags6), DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), + DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),