Don't draw player mobj in first person

This solves that annoying albeit slightly amusing bug
where your sprite clips into your view during a quake.

For OpenGL, this also solves the player's model
rendering while in first person. So you'll no
longer be looking through Sonic's body!
This commit is contained in:
James R 2020-01-16 03:09:16 -08:00
parent bbbe76d2ca
commit 542e38e717
2 changed files with 8 additions and 4 deletions

View file

@ -5422,7 +5422,8 @@ static void HWR_AddSprites(sector_t *sec)
{ {
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
{ {
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW) if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW ||
thing == r_viewmobj)
continue; continue;
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
@ -5445,7 +5446,8 @@ static void HWR_AddSprites(sector_t *sec)
{ {
// Draw everything in sector, no checks // Draw everything in sector, no checks
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)) if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW ||
thing == r_viewmobj))
HWR_ProjectSprite(thing); HWR_ProjectSprite(thing);
} }

View file

@ -1845,7 +1845,8 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
{ {
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
{ {
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW) if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW ||
thing == r_viewmobj)
continue; continue;
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
@ -1868,7 +1869,8 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
{ {
// Draw everything in sector, no checks // Draw everything in sector, no checks
for (thing = sec->thinglist; thing; thing = thing->snext) for (thing = sec->thinglist; thing; thing = thing->snext)
if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)) if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW ||
thing == r_viewmobj))
R_ProjectSprite(thing); R_ProjectSprite(thing);
} }