Fix is_too_near_spawn function bugs. Now you really can abuse mobs near spawn :-P
This commit is contained in:
parent
78bd353d05
commit
1140718507
@ -10,12 +10,12 @@ mobs.protected = tonumber(minetest.setting_get("mobs_spawn_protected")) or 0
|
|||||||
mobs.remove = minetest.setting_getbool("remove_far_mobs") or false
|
mobs.remove = minetest.setting_getbool("remove_far_mobs") or false
|
||||||
|
|
||||||
local function is_too_near_spawn(pos)
|
local function is_too_near_spawn(pos)
|
||||||
if minetest.is_singleplayer() or minetest.setting_getbool("mobs_safe_spawn") then
|
if minetest.is_singleplayer() or not minetest.setting_getbool("mobs_safe_spawn") then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local sp = minetest.setting_getbool("static_spawn_point") or {x = 0, y = 0, z = 0}
|
local sp = minetest.setting_get_pos("static_spawnpoint") or {x = 0, y = 0, z = 0}
|
||||||
local rad = minetest.setting_getbool("static_spawn_radius") or 256
|
local rad = minetest.setting_get("static_spawn_radius") or 256
|
||||||
|
|
||||||
return (vector.distance(pos, sp) < rad)
|
return (vector.distance(pos, sp) < rad)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user