diff --git a/server/src/index.js b/server/src/index.js index bef6749..f4a84c2 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -197,8 +197,9 @@ io.on('connection', socket => { socket.on('move:click', target => { const p = socketsToPlayers.get(socket.id); if (!p) return; - p.x = Math.max(0, Math.min(WORLD.width, target.x)); - p.y = Math.max(0, Math.min(WORLD.height, target.y)); + // You can store target on the server if you want later: + p.targetX = Math.max(0, Math.min(WORLD.width, target.x)); + p.targetY = Math.max(0, Math.min(WORLD.height, target.y)); }); socket.on('gather', async ({ nodeId }, ack) => {