From 4fcd1ae541fa6f0a7a2c643ff0776e03d9468784 Mon Sep 17 00:00:00 2001 From: codiac Date: Mon, 23 Oct 2023 05:32:18 +0000 Subject: [PATCH] Fix slime spawn crash (#3977) Declare global variables before using them! Fixes #3975 Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3977 Reviewed-by: the-real-herowl Co-authored-by: codiac Co-committed-by: codiac --- mods/ENTITIES/mobs_mc/slime+magma_cube.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index 9cc5191bc..321a9c1ce 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -161,6 +161,8 @@ local spawn_children_on_die = function(child_mob, spawn_distance, eject_speed) end end +local swamp_light_max = 7 + local function slime_spawn_check(pos, environmental_light, artificial_light, sky_light) local maxlight = swamp_light_max @@ -308,7 +310,6 @@ local cave_min = mcl_vars.mg_overworld_min local cave_max = water_level - 23 local swampy_biomes = {"Swampland", "MangroveSwamp"} -local swamp_light_max = 7 local swamp_min = water_level local swamp_max = water_level + 27