Skip to content

Commit e9fb1fc

Browse files
committed
ACS SectorSound now plays at the current sector when triggered from polyobject lines, unless vanilla Hexen
1 parent 78cd34e commit e9fb1fc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

source/acs_func.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,8 +2021,15 @@ bool ACS_CF_SectorSound(ACS_CF_ARGS)
20212021
PointThinker *src;
20222022

20232023
// if script started from a line, use the frontsector's sound origin
2024-
if(info->line)
2025-
src = &(info->line->frontsector->soundorg);
2024+
const line_t *const line = info->line;
2025+
if(line)
2026+
{
2027+
sector_t *const sector = !P_LevelIsVanillaHexen() && line->intflags & MLI_DYNASEGLINE ?
2028+
R_PointInSubsector(line->soundorg.x, line->soundorg.y)->sector :
2029+
line->frontsector;
2030+
2031+
src = &(sector->soundorg);
2032+
}
20262033
else
20272034
src = nullptr;
20282035

0 commit comments

Comments
 (0)