diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/depends.txt b/depends.txt old mode 100644 new mode 100755 diff --git a/description.txt b/description.txt old mode 100644 new mode 100755 diff --git a/init.lua b/init.lua old mode 100644 new mode 100755 index 259e75a..4e594a9 --- a/init.lua +++ b/init.lua @@ -13,7 +13,7 @@ of the license, or (at your option) any later version. warps = {} warps_queue = {} queue_state = 0 -local warps_freeze = 5 +local warps_freeze = 1 -- t = time in usec -- p = player obj -- w = warp name @@ -46,15 +46,17 @@ do_warp_queue = function() local t = minetest.get_us_time() for i = table.getn(warps_queue),1,-1 do local e = warps_queue[i] - 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 - warp(e.p, e.w) + 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 t > e.t then + warp(e.p, e.w) + table.remove(warps_queue, i) + end + else + minetest.sound_stop(e.sh) + minetest.chat_send_player(e.p:get_player_name(), "You have to stand still for " .. warps_freeze .. " seconds!") table.remove(warps_queue, i) end - else - minetest.sound_stop(e.sh) - minetest.chat_send_player(e.p:get_player_name(), "You have to stand still for " .. warps_freeze .. " seconds!") - table.remove(warps_queue, i) end end if table.getn(warps_queue) == 0 then @@ -147,6 +149,9 @@ minetest.register_chatcommand("setwarp", { end local player = minetest.get_player_by_name(name) local pos = player:getpos() + if not pos then + return false, "Internal error while getting your position. Please try again later" + end table.insert(warps, { name = param, x = pos.x, y = pos.y, z = pos.z, yaw = player:get_look_yaw(), pitch = player:get_look_pitch() }) save() minetest.log("action", name .. " " .. h .. " warp \"" .. param .. "\": " .. pos.x .. ", " .. pos.y .. ", " .. pos.z) diff --git a/models/warps_warpstone.obj b/models/warps_warpstone.obj old mode 100644 new mode 100755 diff --git a/sounds/LICENSE b/sounds/LICENSE old mode 100644 new mode 100755 diff --git a/sounds/warps_plop.ogg b/sounds/warps_plop.ogg index f214d25..0991925 100644 Binary files a/sounds/warps_plop.ogg and b/sounds/warps_plop.ogg differ diff --git a/sounds/warps_woosh.ogg b/sounds/warps_woosh.ogg index 8c12c24..4570206 100644 Binary files a/sounds/warps_woosh.ogg and b/sounds/warps_woosh.ogg differ diff --git a/textures/warps_warpstone.png b/textures/warps_warpstone.png old mode 100644 new mode 100755 index e172d1d..21d9a16 Binary files a/textures/warps_warpstone.png and b/textures/warps_warpstone.png differ diff --git a/textures/warps_warpstone_guide.png b/textures/warps_warpstone_guide.png old mode 100644 new mode 100755 index 55c73b6..a54a5bf Binary files a/textures/warps_warpstone_guide.png and b/textures/warps_warpstone_guide.png differ