Skip to content

Commit

Permalink
Fix sprite not clipping when pickup close to edge of liquid sector
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Dec 27, 2024
1 parent d2e3508 commit 21ff378
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* An error is no longer displayed when trying to load the *BFG Edition* of *DOOM II*.
* Weapons that use the [*MBF21*](https://doomwiki.org/wiki/MBF21)-compatible `A_ConsumeAmmo` code pointer no longer consume ammo when fired if infinite ammo is enabled using the `infiniteammo` CCMD.
* Animated skies defined using the [*ID24*](https://doomwiki.org/wiki/ID24)-compatible [`SKYDEFS`](https://doomwiki.org/wiki/SKYDEFS) lump are now fully supported.
* Improvements have been made to the clipping of certain sprites when close to the edge of a liquid sector when the `r_liquid_clipsprites` CVAR is `on`.

![](https://github.com/bradharding/www.doomretro.com/raw/master/wiki/bigdivider.png)

Expand Down
13 changes: 7 additions & 6 deletions src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,14 @@ bool P_IsInLiquid(mobj_t *thing)
{
sector_t *highestsector = thing->subsector->sector;

for (const struct msecnode_s *seclist = thing->touching_sectorlist; seclist; seclist = seclist->m_tnext)
{
sector_t *sector = seclist->m_sector;
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;
}
if (sector->floorheight > highestsector->floorheight)
highestsector = sector;
}

return (highestsector->terraintype >= LIQUID && !highestsector->isselfreferencing
&& !(thing->flags & MF_NOGRAVITY));
Expand Down

0 comments on commit 21ff378

Please sign in to comment.