From 7ca55654a35616efcb27d1d598497c935a22e7f1 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Sun, 10 Dec 2023 14:30:04 -0800 Subject: [PATCH] allow mobs to spawn normally if there's no protection areas... --- compat/areas.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compat/areas.lua b/compat/areas.lua index 262de60..4377cf2 100644 --- a/compat/areas.lua +++ b/compat/areas.lua @@ -63,11 +63,17 @@ else }) spawnit.register_pos_check(function(pos) - for _, area in pairs(areas:getAreasAtPos(pos)) do - if area.spawnit_enabled == true then + local as = areas:getAreasAtPos(pos) + if #as == 0 then + return true + end + + for i = 1, #as do + if as[i].spawnit_enabled == true then return true end end + return false, true end) end