Skip to content

Commit

Permalink
Further work on when to clip sprites in liquid sectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Jan 3, 2025
1 parent 0985928 commit 7832a75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,15 +997,16 @@ bool P_IsInLiquid(mobj_t *thing)
{
sector_t *highestsector = thing->subsector->sector;

if (thing->player)
if (thing->player || (thing->flags & MF_SHOOTABLE))
for (const struct msecnode_s *seclist = thing->touching_sectorlist; seclist; seclist = seclist->m_tnext)
{
sector_t *sector = seclist->m_sector;

if (sector->floorheight > highestsector->floorheight)
highestsector = sector;
}
else if (thing->z > thing->floorz)

if (!thing->player && thing->z > highestsector->floorheight + 2 * FRACUNIT)
return false;

return (highestsector->terraintype >= LIQUID);
Expand Down

0 comments on commit 7832a75

Please sign in to comment.