From 2d63dcfcc5b06421ceeb5477ac066fbf4070128c Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Wed, 26 Nov 2025 21:53:49 +0100 Subject: [PATCH] disable TerrainMapData cache for SAB path --- src/core/game/TerrainMapLoader.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/game/TerrainMapLoader.ts b/src/core/game/TerrainMapLoader.ts index 3ea90cbf2..e3f0a0635 100644 --- a/src/core/game/TerrainMapLoader.ts +++ b/src/core/game/TerrainMapLoader.ts @@ -107,8 +107,10 @@ export async function loadTerrainMap( : undefined, sharedDirtyBuffer: undefined, // populated by consumer when needed }; - // Always cache the result, but only use cache when appropriate - loadedMaps.set(map, result); + // Only cache the result when caching is actually used (non-SAB path) + if (shouldUseCache) { + loadedMaps.set(map, result); + } return result; }