mirror of
https://github.com/minetest-mods/warps.git
synced 2024-11-15 06:40:18 +01:00
Merge pull request #2 from everamzah/master
This commit is contained in:
commit
5da8914073
3
init.lua
3
init.lua
|
@ -46,6 +46,7 @@ do_warp_queue = function()
|
||||||
local t = minetest.get_us_time()
|
local t = minetest.get_us_time()
|
||||||
for i = table.getn(warps_queue),1,-1 do
|
for i = table.getn(warps_queue),1,-1 do
|
||||||
local e = warps_queue[i]
|
local e = warps_queue[i]
|
||||||
|
if e.p:getpos() then
|
||||||
if e.p:getpos().x == e.pos.x and e.p:getpos().y == e.pos.y and e.p:getpos().z == e.pos.z then
|
if e.p:getpos().x == e.pos.x and e.p:getpos().y == e.pos.y and e.p:getpos().z == e.pos.z then
|
||||||
if t > e.t then
|
if t > e.t then
|
||||||
warp(e.p, e.w)
|
warp(e.p, e.w)
|
||||||
|
@ -57,6 +58,7 @@ do_warp_queue = function()
|
||||||
table.remove(warps_queue, i)
|
table.remove(warps_queue, i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if table.getn(warps_queue) == 0 then
|
if table.getn(warps_queue) == 0 then
|
||||||
queue_state = 0
|
queue_state = 0
|
||||||
return
|
return
|
||||||
|
@ -137,6 +139,7 @@ minetest.register_chatcommand("setwarp", {
|
||||||
description = "Set a warp location to the players location",
|
description = "Set a warp location to the players location",
|
||||||
privs = { warp_admin = true },
|
privs = { warp_admin = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
param = param:gsub("%W", "")
|
||||||
local h = "created"
|
local h = "created"
|
||||||
for i = 1,table.getn(warps) do
|
for i = 1,table.getn(warps) do
|
||||||
if warps[i].name == param then
|
if warps[i].name == param then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user