From d522408928d1cff3e246921fb2bbacf08cdd44e0 Mon Sep 17 00:00:00 2001 From: Atlaskor Date: Thu, 13 Nov 2025 17:07:28 +0000 Subject: [PATCH] Update server/src/index.js --- server/src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) => {