From fe01081db51b19205d7d54c16afb105c90ae475d Mon Sep 17 00:00:00 2001 From: onezDerv Date: Sun, 29 Sep 2024 04:00:19 -0400 Subject: [PATCH] fix node issue --- common/player.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/player.js b/common/player.js index 20d6dbf..114d762 100644 --- a/common/player.js +++ b/common/player.js @@ -1,6 +1,4 @@ -if (!crypto) { - crypto = import('node:crypto'); -} +const crypto = (typeof window === 'undefined') ? await import('node:crypto') : crypto; function distF(ent, target) { return ((ent.pos.x - target.pos.x) ** 2) + ((ent.pos.y - target.pos.y) ** 2)