From bb53defd92b7d0bf85b31b5bd60fd804c0e202df Mon Sep 17 00:00:00 2001 From: redbirdly <155550833+redbirdly@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:24:37 +0800 Subject: [PATCH] fix loading --- mods/lightmap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/lightmap.js b/mods/lightmap.js index 93ddcdf0..c5dc0d3b 100644 --- a/mods/lightmap.js +++ b/mods/lightmap.js @@ -265,9 +265,9 @@ elements.plasma.tick = function(pixel) { lightmap[y][x] = { color: plasmaColor }; }; -// Wait for loading -// if it loads too soon then width will be undefined -setTimeout(() => { initializeLightmap(width, height); }, 700); +window.addEventListener('load', function() { + initializeLightmap(width, height); +}); // Add code to functions instead of replacing them let originalTick = tick;