Stop dormant sounds from still playing after a map reset
These patches address this ticket on the tracker: https://zandronum.com/tracker/view.php?id=3887
They stop all sounds made by actors that are destroyed during a map reset, any unattached (i.e. positioned) sounds, or sounds played with the ACS function AmbientSound. In the past, sounds like these would still play after the map had reset in Survival or LMS, which only sounded weird.
I also added an example wad to test out these changes.
1. Start a new game in Survival.
2. When there's about 2-3 seconds left in the countdown, either summon the "Test" actor or do puke 1 in the console, or both.
3. In 3.0, you'll notice the sounds continue playing even after the map has reset. In 3.1 with these patches added, the sounds are stopped as they should be.
The patches should get the job done, but SERVERCOMMANDS_DestroyThingAndStopSounds looks kind of overspecialized to me. I assume you lumped these two actions into one function to save network bandwidth, right? Since this function is only called on a map reset (for now), I think the code would be more flexible for future use if you instead add "SERVERCOMMANDS_StopAllSoundsFromActor" and use the existing function to destroy the actor.
BTW: I already added 10474 and 10478 since they'll be necessary in any case.
I added another patch which fixes the function S_StopAllSoundsFromActor not actually stopping all the sounds that an actor's playing. It would only stop one channel, but never multiple channels simultaneously.