diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 22:39:19 -0800 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-01-15 22:39:19 -0800 |
commit | 53cfc8f32747f985a59ac640f4d30f7ed109728b (patch) | |
tree | 743d24d21e820f87b7c362991b4a8d57c5bae56b | |
parent | 0ab05bc3355d8540388ff684a977225b9bf6582c (diff) |
Discard attempts outside circle radius, instead of square
-rw-r--r-- | init.lua | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |