diff options
| author | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 10:14:01 +0100 | 
|---|---|---|
| committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 10:14:01 +0100 | 
| commit | 7b7aa45da8bd17322ab6607475fb8bb75f8609c3 (patch) | |
| tree | b9db8a21caca032f2561985a0ae81f341dda2d32 | |
| parent | e23f47922b4ae0815209a35a5c3db64337dd92b4 (diff) | |
have protection check right before spawning mob
| -rw-r--r-- | api.lua | 14 | 
1 files changed, 7 insertions, 7 deletions
@@ -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  | 
