From 53cfc8f32747f985a59ac640f4d30f7ed109728b Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 15 Jan 2015 22:39:19 -0800 Subject: Discard attempts outside circle radius, instead of square --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index c29d931..a930679 100644 --- a/init.lua +++ b/init.lua @@ -222,6 +222,11 @@ local function sed() z = math.random(playerpos.z - radius, playerpos.z + radius) } + -- keep it in a real circle + if (pos.x - playerpos.x) * (pos.x - playerpos.x) + (pos.z - playerpos.z) * (pos.z - playerpos.z) > radius * radius then + return + end + stat_considered = stat_considered + 1 -- force load map -- cgit v1.2.3