repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 2c74547540b036c64dc0f40c9386ca3f863344f5:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 2c74547540b036c64dc0f40c9386ca3f863344f5
Author: James Baicoianu 
Date:   Fri Jun 26 08:29:29 2020 -0700

    Set room on children when player room changes

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index 2b7348928e042f2d135e198b45676186df218c90..
index ..c08ed2a63498e9b60f0f3496104343197823b271 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -430,13 +430,6 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
       if (this.gazecaster) {
         this.gazecaster.room = room;
       }
-/*
-      if (!this.teleporter) {
-        this.teleporter = this.room.createObject('user_teleporter');
-      } else {
-        this.teleporter.setRoom(room.getProxyObject());
-      }
-*/
       if (!this.room.selfavatar && this.ghost) {
         this.ghost.die();
         this.ghost = false;
@@ -454,6 +447,14 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
         });
         this.visible = true;
       }
+
+      for (let k in this.children) {
+        if (this.children[k].setRoom) {
+          this.children[k].setRoom(room);
+          this.children[k].start();
+        }
+      }
+
       //room.add(this);
       this.updateGravity();
     }
@@ -491,6 +492,7 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
     this.getProxyObject = function() {
       var proxy = new elation.proxy(this, {
         parent:        ['accessor', 'parent.getProxyObject'],
+        room:          ['property', 'room'],
         pos:           ['property', 'position'],
         vel:           ['property', 'velocity'],
         accel:         ['property', 'acceleration'],

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