refactor: don't play sound on server

This commit is contained in:
cha0s 2021-03-14 09:50:22 -05:00
parent d14b272320
commit a775c5bfd6

View File

@ -98,10 +98,12 @@ export default (latus) => class Audible extends Trait {
playSound: (key) => {
if (this.entity.hasSound(key)) {
Promise.resolve(this.#sounds[key]).then((sound) => {
sound.play();
});
if ('client' !== process.env.SIDE) {
if ('client' === process.env.SIDE) {
Promise.resolve(this.#sounds[key]).then((sound) => {
sound.play();
});
}
else {
this.#playing[key] = true;
this.markAsDirty();
}