From 8bc140e23fc486afb91ee2c2ad956dad507cd277 Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Wed, 26 Nov 2025 21:55:37 +0100 Subject: [PATCH] refactored loadTerrainMap to reuse the existing canUseSharedBuffers --- src/core/game/TerrainMapLoader.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/game/TerrainMapLoader.ts b/src/core/game/TerrainMapLoader.ts index e3f0a0635..3f7e52774 100644 --- a/src/core/game/TerrainMapLoader.ts +++ b/src/core/game/TerrainMapLoader.ts @@ -58,11 +58,7 @@ export async function loadTerrainMap( const stateBuffer = sharedStateBuffer ?? - (typeof SharedArrayBuffer !== "undefined" && - typeof Atomics !== "undefined" && - // crossOriginIsolated is only defined in browser contexts - typeof (globalThis as any).crossOriginIsolated === "boolean" && - (globalThis as any).crossOriginIsolated === true + (canUseSharedBuffers ? new SharedArrayBuffer( manifest.map.width * manifest.map.height *