diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-18 17:41:37 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-18 17:41:37 -0500 |
commit | a66c8ade0ceba8ad4b6f84ffde258df1d0c689c3 (patch) | |
tree | 5e268d056a49d3d0fe7813bd5f109956c2248bce | |
parent | 92e1659c82243a05bb4819b825da112046ce6dca (diff) |
fixed socket.js cursor
-rw-r--r-- | socket.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -36,7 +36,7 @@ class Socket extends retryws { case 'write': this.emit('write', msg.accepted, msg.rejected); break; // A confirmation message for writes (accepted/rejected updates) case 'cursor': - this.emit('cursor', msg.positions, msg.sender); break; // Must be used for self-identification + this.emit('cursor', msg.positions.map(pos => [pos.tileY*8+pos.charY,pos.tileX*16+pos.charX]), msg.sender); break; // Must be used for self-identification case 'tileUpdate': this.emit('tileUpdate', msg.sender, msg.source, msg.tiles); break; // Any change by another user or possibly oneself case 'fetch': @@ -82,7 +82,7 @@ class Socket extends retryws { "tileY": Math.floor(coords[0]/8), "tileX": Math.floor(coords[1]/16), "charY": coords[0] % 8, - "charX": coords[0] % 16 + "charX": coords[1] % 16 } ] })); |