From 1140718507439cbc9d510f16a8df4b4ea89e3104 Mon Sep 17 00:00:00 2001 From: melzua Date: Thu, 5 Nov 2015 10:39:36 +0100 Subject: [PATCH] Fix is_too_near_spawn function bugs. Now you really can abuse mobs near spawn :-P --- mods/mobs/api.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index 9642c9d..807db0d 100644 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -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 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 end - local sp = minetest.setting_getbool("static_spawn_point") or {x = 0, y = 0, z = 0} - local rad = minetest.setting_getbool("static_spawn_radius") or 256 + local sp = minetest.setting_get_pos("static_spawnpoint") or {x = 0, y = 0, z = 0} + local rad = minetest.setting_get("static_spawn_radius") or 256 return (vector.distance(pos, sp) < rad) end @@ -1670,4 +1670,4 @@ function mobs:feed_tame(self, clicker, feed_count, breed) else return false end -end \ No newline at end of file +end