From 08a2ff906b3ca833cc3babb026432fdf4fe4ce53 Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:41:27 +0100 Subject: [PATCH] dedup tileRef for tileUpdateSink(tileRef) --- src/core/GameRunner.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/GameRunner.ts b/src/core/GameRunner.ts index eddb1223d..af063633f 100644 --- a/src/core/GameRunner.ts +++ b/src/core/GameRunner.ts @@ -181,9 +181,13 @@ export class GameRunner { let packedTileUpdates: BigUint64Array; const tileUpdates = updates[GameUpdateType.Tile]; if (this.tileUpdateSink !== undefined) { + const seenTiles = new Set(); for (const u of tileUpdates) { const tileRef = Number(u.update >> 16n) as TileRef; - this.tileUpdateSink(tileRef); + if (!seenTiles.has(tileRef)) { + seenTiles.add(tileRef); + this.tileUpdateSink(tileRef); + } } packedTileUpdates = new BigUint64Array(); } else {