refactor: don't play sound on server
This commit is contained in:
parent
d14b272320
commit
a775c5bfd6
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user