Merge branch 'double-drawdist-flag' into 'master'

Double drawdist flag

See merge request KartKrew/Kart!1106
This commit is contained in:
James R 2023-03-28 09:41:07 +00:00
commit c702e37ae2
4 changed files with 22 additions and 8 deletions

View file

@ -5685,7 +5685,7 @@ const char *const MOBJFLAG_LIST[] = {
"BOSS",
"SPAWNCEILING",
"NOGRAVITY",
"AMBIENT",
"DRAWFROMFARAWAY",
"SLIDEME",
"NOCLIP",
"FLOAT",

View file

@ -19016,7 +19016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -28256,7 +28256,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -28283,7 +28283,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY, // flags
S_NULL // raisestate
},

View file

@ -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,
// This object is an ambient sound. Obsolete, but keep this around for backwards compatibility.
MF_AMBIENT = 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!

View file

@ -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;