repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 8703b7d0d88a6102c77edfbbccffda505ab5e17e:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 8703b7d0d88a6102c77edfbbccffda505ab5e17e
Author: James Baicoianu 
Date:   Wed Apr 24 17:14:12 2019 -0700

    Workaround for ndefined player position

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index 3a42168a8c9d8a8ec48fae599edc99b422d1ce7a..
index ..db5fec9106b51b3fcc8334dbca8077dc77938f07 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -343,6 +343,10 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
     this.updateVectors = function() {
       var v = this.vectors;
       if (this.objects['3d']) {
+        let playerpos = this.properties.position;
+        if (typeof playerpos.x == 'undefined' || isNaN(playerpos.x)) playerpos.x = 0;
+        if (typeof playerpos.y == 'undefined' || isNaN(playerpos.y)) playerpos.y = 0;
+        if (typeof playerpos.z == 'undefined' || isNaN(playerpos.z)) playerpos.z = 0;
         this.objects['3d'].updateMatrix();
         this.objects['3d'].updateMatrixWorld();
         this.objects['3d'].matrixWorld.extractBasis(v.xdir, v.ydir, v.zdir)

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