diff --git a/src/deh_tables.c b/src/deh_tables.c index bacb32563..7d4f8d990 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5685,7 +5685,7 @@ const char *const MOBJFLAG_LIST[] = { "BOSS", "SPAWNCEILING", "NOGRAVITY", - "\x01", // free: 1<<10 (name un-matchable) + "DRAWFROMFARAWAY", "SLIDEME", "NOCLIP", "FLOAT", diff --git a/src/p_mobj.h b/src/p_mobj.h index aee8cda1a..3ee45aedd 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -122,8 +122,8 @@ typedef enum // Don't apply gravity (every tic); object will float, keeping current height // or changing it actively. MF_NOGRAVITY = 1<<9, - // Free: - // 1<<10 + // This object is visible from a greater distance than normal objects. + MF_DRAWFROMFARAWAY = 1<<10, // Slide this object when it hits a wall. MF_SLIDEME = 1<<11, // Don't collide with walls or solid objects. Two MF_NOCLIP objects can't touch each other at all! diff --git a/src/r_things.c b/src/r_things.c index c8ef9b557..a4480cf69 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -3618,9 +3618,23 @@ boolean R_ThingWithinDist (mobj_t *thing, fixed_t limit_dist) { const fixed_t dist = R_PointToDist(thing->x, thing->y); - if (limit_dist && dist > limit_dist) + if (limit_dist) { - return false; + if (thing->flags & MF_DRAWFROMFARAWAY) + { + // MF_DRAWFROMFARAWAY: visible from 2x drawdist + if (dist > limit_dist * 2) + { + return false; + } + } + else + { + if (dist > limit_dist) + { + return false; + } + } } return true;