repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 3bfa92af095732996c5b88ea039e7ea695544cd8:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 3bfa92af095732996c5b88ea039e7ea695544cd8
Author: James Baicoianu 
Date:   Sun Jul 5 09:29:29 2020 -0700

    Fix for double player collider problem

diff --git a/scripts/room.js b/scripts/room.js
index c07b1f4e5dfc1f5f2b2d4b20ff3490fba0677998..
index ..47a7bd28ba671e7094040d4bdb76cb84d37ab42a 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -211,7 +211,10 @@ elation.require([
         orientation = spawnpoint.orientation;
       }
       var player = this.engine.client.player;
-      this.appendChild(player);
+      if (player.parent !== this) {
+        // Reparent player to the room if necessary
+        this.appendChild(player.getProxyObject());
+      }
       player.position.copy(pos);
       player.orientation.copy(orientation);
       //player.reset_position();
@@ -1202,6 +1205,8 @@ elation.require([
       if (proxyobj) {
         if (proxyobj.parent && typeof proxyobj.parent.removeChild == 'function') {
           proxyobj.parent.removeChild(proxyobj);
+        } else if (proxyobj._target.parent && typeof proxyobj._target.parent.remove == 'function') {
+          proxyobj._target.parent.remove(proxyobj._target);
         }
         //var realobj = this.room.getObjectFromProxy(proxyobj);
         var realobj = proxyobj._target;

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