summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/api.lua b/api.lua
index 90b4c2e..52b5232 100644
--- a/api.lua
+++ b/api.lua
@@ -3270,13 +3270,6 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
return
end
- -- mobs cannot spawn in protected areas when enabled
- if not spawn_protected
- and minetest.is_protected(pos, "") then
---print ("--- inside protected area", name)
- return
- end
-
-- only spawn away from player
local objs = minetest.get_objects_inside_radius(pos, 10)
@@ -3302,6 +3295,13 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
end
end
+ -- mobs cannot spawn in protected areas when enabled
+ if not spawn_protected
+ and minetest.is_protected(pos, "") then
+--print ("--- inside protected area", name)
+ return
+ end
+
-- spawn mob half block higher than ground
pos.y = pos.y + 0.5