aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--socket.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/socket.js b/socket.js
index 7a88ff6..f2502e8 100644
--- a/socket.js
+++ b/socket.js
@@ -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
}
]
}));