repo: janusweb
action: commit
revision: 
path_from: 
revision_from: ebe108a4aaa425919d247006fe45733ead4a8879:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit ebe108a4aaa425919d247006fe45733ead4a8879
Author: James Baicoianu 
Date:   Tue Nov 2 01:23:32 2021 -0700

    Player position setting fixes

diff --git a/scripts/room.js b/scripts/room.js
index 6b89edfb334d419aedd84a9e86c3a598e515dce9..
index ..65df0ccc1e973130ff784919e0a4473be0c279b6 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -227,15 +227,15 @@ elation.require([
         // Reparent player to the room if necessary
         this.appendChild(player.getProxyObject());
       }
+      player.reset_position();
       player.position.copy(pos);
       player.orientation.copy(orientation);
-      //player.reset_position();
       player.properties.movestrength = 80 * this.properties.walk_speed;
       player.properties.runstrength = 80 * this.properties.run_speed;
       player.cursor_visible = (!janus.hmd ? elation.utils.any(this.cursor_visible, true) : false);
       player.cursor_opacity = elation.utils.any(this.cursor_opacity, .8);
       // FIXME - for some reason the above call sometimes orients the player backwards.  Doing it on a delay fixes it...
-      setTimeout(elation.bind(player, player.reset_position), 0);
+      //setTimeout(elation.bind(player, player.reset_position), 0);
     }
     this.setHash = function(hash) {
       this.urlhash = hash;
@@ -853,7 +853,9 @@ elation.require([
             });
           }
         }
-        setTimeout(() => this.setPlayerPosition(), 0);
+        if (this.active) {
+          setTimeout(() => this.setPlayerPosition(), 0);
+        }

         if (typeof room.skybox != 'undefined') this.properties.skybox = room.skybox;
         if (room.skybox_equi) this.properties.skybox_equi = room.skybox_equi;

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