twhl-community / halflife-updated

Half-Life SDK updated to compile under VS2019 and 2022. Check README.md for more information.
Other
382 stars 146 forks source link

Egon attack sound gets cut when using the flashlight #197

Closed Ronin4862 closed 1 year ago

Ronin4862 commented 1 year ago

https://youtu.be/xThWe-3ic44

Turning the flashlight ON or OFF while firing the egon gun results in attack sound getting cut off briefly.

SamVanheer commented 1 year ago

That's because both sounds are played on the player entity's weapon sound channel. Entities have a few sound channels each but only one sound can play on a given channel at any time. There is also an overall limit to the number of active channels across all entities so this can happen if enough sounds are started by other entities as well.

It can't be fixed without completely replacing the sound system (as the Unified SDK does) and redesigning the sound channel system which requires more than 500 references to be updated. This would involve reworking how sounds are started and stopped since a lot of code depends on sounds being stopped by another sound starting on the same channel.

That's well out of scope for either project, so it will remain as it is.