wp_fgrep added
parent
882702878e
commit
42d33d92a7
31
init.lua
31
init.lua
|
@ -235,7 +235,7 @@ local function position_shift(p)
|
||||||
if distance == 0 then return end
|
if distance == 0 then return end
|
||||||
|
|
||||||
here[d] = here[d] + distance
|
here[d] = here[d] + distance
|
||||||
here.y = here.y - 1 -- correction
|
-- here.y = here.y - 1 -- correction
|
||||||
|
|
||||||
minetest.run_server_chatcommand('teleport', tostring_point(here))
|
minetest.run_server_chatcommand('teleport', tostring_point(here))
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ local function position_shift2(p)
|
||||||
here.y = here.y+shift.y
|
here.y = here.y+shift.y
|
||||||
here.z = here.z+shift.z
|
here.z = here.z+shift.z
|
||||||
|
|
||||||
here.y = here.y - 1 -- correction
|
-- here.y = here.y - 1 -- correction
|
||||||
|
|
||||||
minetest.run_server_chatcommand('teleport', tostring_point(here))
|
minetest.run_server_chatcommand('teleport', tostring_point(here))
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ minetest.register_chatcommand('tp', {
|
||||||
-- wp_grep written by erstazi (player at Linux-Forks.de )
|
-- wp_grep written by erstazi (player at Linux-Forks.de )
|
||||||
minetest.register_chatcommand('wp_grep', {
|
minetest.register_chatcommand('wp_grep', {
|
||||||
params = '<name>',
|
params = '<name>',
|
||||||
description = 'lists waypoints',
|
description = 'lists matching waypoints',
|
||||||
func = safe(function(param)
|
func = safe(function(param)
|
||||||
local wpname = param
|
local wpname = param
|
||||||
local count = 0
|
local count = 0
|
||||||
|
@ -522,3 +522,28 @@ minetest.register_chatcommand('wp_grep', {
|
||||||
end),
|
end),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_chatcommand('wp_fgrep', {
|
||||||
|
params = '<name>',
|
||||||
|
description = 'lists matching waypoints',
|
||||||
|
func = safe(function(param)
|
||||||
|
local wpname = param
|
||||||
|
local count = 0
|
||||||
|
for name, point in pairsByKeys(waypoints, lc_cmp) do
|
||||||
|
if string.find(name, wpname,1,true) then
|
||||||
|
count = count + 1
|
||||||
|
minetest.display_chat_message(
|
||||||
|
('%s -> %s'):format(name, tostring_point(point))
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if count == 0 then
|
||||||
|
minetest.display_chat_message(('waypoint "%s" not found.'):format(wpname))
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue