mirror of
https://github.com/HybridDog/builtin_item.git
synced 2024-12-22 17:00:27 +01:00
use get_node more selden
This commit is contained in:
parent
06cfcc90fe
commit
f6629da1ba
9
init.lua
9
init.lua
@ -5,11 +5,16 @@ local last_tab
|
|||||||
local function get_nodes(pos)
|
local function get_nodes(pos)
|
||||||
local rnd_pos = vector.round(pos)
|
local rnd_pos = vector.round(pos)
|
||||||
local t = tonumber(os.clock())
|
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
|
and t-time < 10 then
|
||||||
return last_tab
|
return last_tab
|
||||||
end
|
end
|
||||||
time = t
|
if not tmp then
|
||||||
|
time = t+10
|
||||||
|
else
|
||||||
|
time = t
|
||||||
|
end
|
||||||
lastpos = rnd_pos
|
lastpos = rnd_pos
|
||||||
local tab,n = {},1
|
local tab,n = {},1
|
||||||
for i = -1,1,2 do
|
for i = -1,1,2 do
|
||||||
|
Loading…
Reference in New Issue
Block a user