repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 907f5f1dd92be948d48c84fc38756f2535cad661:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 907f5f1dd92be948d48c84fc38756f2535cad661
Author: James Baicoianu 
Date:   Tue Jun 30 15:50:45 2020 -0700

    Minor tweaks to formatting and variable names to avoid variable shadowing

diff --git a/scripts/janusbase.js b/scripts/janusbase.js
index f239ec627f3096bbc8ba889fba448767f202e936..
index ..03e1bdd61a96da79ed2202d919c712a11fb103d2 100644
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -144,7 +144,7 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
           var colliderasset = this.getAsset('model', collision_id);
           if (colliderasset) {
             var processMeshCollider = elation.bind(this, function(collider) {
-            this.extractColliders(collider);
+              this.extractColliders(collider);
               //collider.userData.thing = this;

               //collider.bindPosition(this.position);
@@ -405,6 +405,8 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
           removeClass:         ['function', 'removeClass'],
           hasClass:            ['function', 'hasClass'],
           raycast:             ['function', 'raycast'],
+          start:               ['function', 'start'],
+          stop:                ['function', 'stop'],
           getElementsByTagName:['function', 'getElementsByTagName'],
         });

@@ -1078,15 +1080,17 @@ console.log('clone', props);
         }
       }
     }
-    this.setRoom = function(room, ischild) {
-      if (this.room !== room) {
+    this.setRoom = function(newroom, ischild) {
+      if (room._target) room = room._target; // If the proxy object is passed in, use its target instead
+
+      if (this.room !== newroom) {
         if (!ischild) {
           this.stop();
         }
-        this.room = room;
+        this.room = newroom;
         for (let k in this.children) {
           if (this.children[k].setRoom) {
-            this.children[k].setRoom(room, true);
+            this.children[k].setRoom(newroom, true);
           }
         }
         if (!ischild) {

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