From 89b277111ade7f059ac5addeea52bf216634509c Mon Sep 17 00:00:00 2001 From: Victor Lasserre Date: Thu, 21 Dec 2023 12:15:18 +0100 Subject: [PATCH] no more death softlock --- public_html/js/global.js | 10 +++++++--- public_html/js/network.js | 1 - public_html/js/render.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public_html/js/global.js b/public_html/js/global.js index 90136b7..04f69db 100644 --- a/public_html/js/global.js +++ b/public_html/js/global.js @@ -46,7 +46,10 @@ function updatePlayer(data) { player.x=data.x; player.y=data.y; - player.z=data.z; + if(data.z==undefined) + player.z=0; + else + player.z=data.z; } else { @@ -57,8 +60,9 @@ function updatePlayer(data) players[i].x=data.x; players[i].y=data.y; if(data.z==undefined) - data.z=0; - players[i].z=data.z; + players[i].z=0; + else + players[i].z=data.z; players[i].dir=data.dir; players[i].visibleDir=data.visibleDir; break; diff --git a/public_html/js/network.js b/public_html/js/network.js index ae4ff3f..553e1b7 100644 --- a/public_html/js/network.js +++ b/public_html/js/network.js @@ -7,7 +7,6 @@ class Network{ message(data){ switch(data.type){ - case 'connect': this.playerId = data.data.playerId; for (let i = 0; i