repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 89ef291392dac1e1e0c7993674b48babff04b355:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 89ef291392dac1e1e0c7993674b48babff04b355
Author: James Baicoianu 
Date:   Tue Nov 2 01:26:52 2021 -0700

    room.playSound() now supports asset and js_id modes

diff --git a/scripts/room.js b/scripts/room.js
index 65df0ccc1e973130ff784919e0a4473be0c279b6..
index ..70ea8f3bc45b3d7ae2464048ce7f6382cc53802c 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -1584,9 +1584,13 @@ console.log('connect room audio to graph', this.audionodes.gain, this.audionodes
     }
     this.playSound = function(name, properties) {
       if (!this.sounds[name]) {
-        this.sounds[name] = this.createObject('Sound', {
-          id: name
-        });
+        if (room.objects[name]) {
+          this.sounds[name] = room.objects[name];
+        } else {
+          this.sounds[name] = this.createObject('Sound', {
+            id: name
+          });
+        }
       }
       if (this.sounds[name]) {
         if (properties) {

-----END OF PAGE-----