From 4362112b8c4d199fb7d404343aa68f9263b6fd4b Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Mon, 20 Feb 2023 18:16:53 -0500 Subject: [PATCH] Add check for nil player for skybox update --- skybox.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/skybox.lua b/skybox.lua index b98abe9..0e9d9f2 100644 --- a/skybox.lua +++ b/skybox.lua @@ -19,11 +19,10 @@ local timer = 0 minetest.register_globalstep(function(dtime) - local players = minetest.get_connected_players() - timer = timer + dtime + if timer > 5 then + local players = minetest.get_connected_players() - if timer > 5 and #players > 0 then for _, player in ipairs(players) do if not player then return