aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua31
1 files changed, 28 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 787ce45..51f1021 100644
--- a/init.lua
+++ b/init.lua
@@ -235,7 +235,7 @@ local function position_shift(p)
if distance == 0 then return end
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))
@@ -281,7 +281,7 @@ local function position_shift2(p)
here.y = here.y+shift.y
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))
@@ -503,7 +503,7 @@ minetest.register_chatcommand('tp', {
-- wp_grep written by erstazi (player at Linux-Forks.de )
minetest.register_chatcommand('wp_grep', {
params = '<name>',
- description = 'lists waypoints',
+ description = 'lists matching waypoints',
func = safe(function(param)
local wpname = param
local count = 0
@@ -522,3 +522,28 @@ minetest.register_chatcommand('wp_grep', {
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),
+})
+
+
+
+