Skip to content

Commit b150e6f

Browse files
committed
refactored loadTerrainMap to reuse the existing canUseSharedBuffers
1 parent 30d2879 commit b150e6f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/core/game/TerrainMapLoader.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ export async function loadTerrainMap(
5858

5959
const stateBuffer =
6060
sharedStateBuffer ??
61-
(typeof SharedArrayBuffer !== "undefined" &&
62-
typeof Atomics !== "undefined" &&
63-
// crossOriginIsolated is only defined in browser contexts
64-
typeof (globalThis as any).crossOriginIsolated === "boolean" &&
65-
(globalThis as any).crossOriginIsolated === true
61+
(canUseSharedBuffers
6662
? new SharedArrayBuffer(
6763
manifest.map.width *
6864
manifest.map.height *

0 commit comments

Comments
 (0)