AudioSystem should raise a cancellable event to block audio from playing #5611
Labels
Area: Audio
Difficulty: 1-Easy
Not impossible to figure out for newer coders, and simple for experienced ones.
Issue: Feature
This issue is a feature request
There should be some way for content to prevent entities from making sounds. E.g., admin ghosts shouldn't make noise.
While it could just be implemented in content by ensuring that checks are performed before any audio system methods are called, it'd probably be much easier to just make the audio methods raise an attempt event. I.e.,
PlayEntity
andPlayPvs
should raise a cancellable event directed at the entity that the sound is being attached to. For audio being attached to a position rather than entity, I don't think there's an easy fix so that'd be up to content to block the method from being called.The text was updated successfully, but these errors were encountered: