mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-07 21:47:30 +01:00
Ensure area is walkable for /tpc
Don't spawn in rock. :)
This commit is contained in:
parent
f06658f319
commit
07b44e6b29
4
init.lua
4
init.lua
@ -90,7 +90,7 @@ local function tpc_send(player,coordinates)
|
|||||||
if minetest.check_player_privs(pname, {tp_admin=true}) then
|
if minetest.check_player_privs(pname, {tp_admin=true}) then
|
||||||
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
||||||
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
||||||
pname:setpos(target_coords)
|
pname:setpos(find_free_position_near(target_coords))
|
||||||
else
|
else
|
||||||
local protected = minetest.is_protected(target_coords,pname)
|
local protected = minetest.is_protected(target_coords,pname)
|
||||||
if protected then
|
if protected then
|
||||||
@ -102,7 +102,7 @@ local function tpc_send(player,coordinates)
|
|||||||
end
|
end
|
||||||
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
||||||
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
||||||
pname:setpos(target_coords)
|
pname:setpos(find_free_position_near(target_coords))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user