From 0e6d4acfdd9b915e595740397fdae421453167b3 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Fri, 20 Feb 2026 02:34:21 -0500 Subject: [PATCH] feat: Implement block deletion handling in WebSocket message processing --- client/src/store/turtleStore.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/store/turtleStore.js b/client/src/store/turtleStore.js index 68265bf..8c04173 100644 --- a/client/src/store/turtleStore.js +++ b/client/src/store/turtleStore.js @@ -134,6 +134,16 @@ export const useTurtleStore = create((set, get) => ({ } })); } + } else if (data.type === 'block_deleted') { + // Remove a block from the world map (turtle moved into it) + if (data.x !== undefined && data.y !== undefined && data.z !== undefined) { + set(state => { + const key = `${data.x},${data.y},${data.z}`; + return { + worldBlocks: state.worldBlocks.filter(b => `${b.x},${b.y},${b.z}` !== key) + }; + }); + } } } catch (error) { console.error('Error processing message:', error);