Skip to content

Commit

Permalink
Doom: fix sector's sound origin for large levels (#1212)
Browse files Browse the repository at this point in the history
Thanks @kitchen-ace for suggestion to have a fix.
Thanks @rfomin for suggesting a fix from PrBoom+.

Dear reader, please note: this fix is not hot-swappable and will require savegame or level reloading.

Co-authored-by: kitchen-ace <[email protected]>
Co-authored-by: Roman Fomin <[email protected]>
  • Loading branch information
3 people authored Aug 8, 2024
1 parent f171ede commit 07cd159
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/doom/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,17 @@ void P_GroupLines (void)
}

// set the degenmobj_t to the middle of the bounding box
if (!crispy->soundfix)
{
sector->soundorg.x = (bbox[BOXRIGHT]+bbox[BOXLEFT])/2;
sector->soundorg.y = (bbox[BOXTOP]+bbox[BOXBOTTOM])/2;
}
else
{
// [crispy] Andrey Budko: fix sound origin for large levels
sector->soundorg.x = bbox[BOXRIGHT]/2+bbox[BOXLEFT]/2;
sector->soundorg.y = bbox[BOXTOP]/2+bbox[BOXBOTTOM]/2;
}

// adjust bounding box to map blocks
block = (bbox[BOXTOP]-bmaporgy+MAXRADIUS)>>MAPBLOCKSHIFT;
Expand Down

0 comments on commit 07cd159

Please sign in to comment.