mirror of
https://gitea.your-land.de/whosit/cmd_eval.git
synced 2025-06-22 17:48:02 +02:00
actually use oir for oir
This commit is contained in:
parent
65e1e684d3
commit
7892615f3c
11
init.lua
11
init.lua
@ -164,16 +164,7 @@ oir(radius) -- return iterator for objects around you
|
|||||||
oir = function(radius)
|
oir = function(radius)
|
||||||
local me = core.get_player_by_name(player_name)
|
local me = core.get_player_by_name(player_name)
|
||||||
if me then
|
if me then
|
||||||
local objs = core.get_objects_inside_radius(me:get_pos(), radius)
|
return core.objects_inside_radius(me:get_pos(), radius)
|
||||||
local nextkey, v
|
|
||||||
--local i = 1
|
|
||||||
return function()
|
|
||||||
-- FIXME skip invalid objects here?
|
|
||||||
nextkey, v = next(objs, nextkey)
|
|
||||||
return v
|
|
||||||
-- i = i + 1
|
|
||||||
-- return objs[i]
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
return function() return nil end
|
return function() return nil end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user