From f6629da1ba05c0bbccc88af1a8a200ec09d4ac10 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 31 Aug 2014 14:49:25 +0200 Subject: [PATCH] use get_node more selden --- init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index cc84793..984b6b3 100644 --- a/init.lua +++ b/init.lua @@ -5,11 +5,16 @@ local last_tab local function get_nodes(pos) local rnd_pos = vector.round(pos) local t = tonumber(os.clock()) - if vector.equals(rnd_pos, lastpos) + local tmp = vector.equals(rnd_pos, lastpos) + if tmp and t-time < 10 then return last_tab end - time = t + if not tmp then + time = t+10 + else + time = t + end lastpos = rnd_pos local tab,n = {},1 for i = -1,1,2 do