Merge pull request #683 from redbirdly/main
This commit is contained in:
commit
e0cd243156
|
|
@ -266,8 +266,19 @@ elements.plasma.tick = function(pixel) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wait for loading
|
// Wait for loading
|
||||||
// if it loads too soon then width will be undefined
|
let i = 0;
|
||||||
setTimeout(() => { initializeLightmap(width, height); }, 700);
|
let interval = setInterval(() => {
|
||||||
|
if (typeof width !== 'undefined') {
|
||||||
|
clearInterval(interval);
|
||||||
|
initializeLightmap(width, height);
|
||||||
|
}
|
||||||
|
i += 1;
|
||||||
|
// if width is not defined for 3 seconds or longer, it's probably broken, so it will just try run the function anyways to see the error
|
||||||
|
if (i >= 30) {
|
||||||
|
clearInterval(interval);
|
||||||
|
initializeLightmap(width, height);
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
// Add code to functions instead of replacing them
|
// Add code to functions instead of replacing them
|
||||||
let originalTick = tick;
|
let originalTick = tick;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue