fix position diff (not just <0.1)

This commit is contained in:
Romain Beaumont 2015-08-25 23:41:27 +02:00
parent ac982ab881
commit 3edc0c5265

2
app.js
View file

@ -197,7 +197,7 @@ server.on('login', function(client) {
function sendRelativePositionChange(client,newPosition,onGround) {
if (uuidToPlayer[client.uuid].position) {
var diff = newPosition.minus(uuidToPlayer[client.uuid].position);
if(diff.distanceTo(new vec3(0,0,0))>0.1)
if(diff.distanceTo(new vec3(0,0,0))!=0)
getOtherClients().forEach(function (otherClient) {
otherClient.write('rel_entity_move', {
entityId: uuidToPlayer[client.uuid].id,