mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-06 13:07:33 +01:00
Remove duplicated code
This commit is contained in:
parent
fb0ec6ca24
commit
8555e135a6
13
init.lua
13
init.lua
@ -53,16 +53,7 @@ function tpr_teleport_player()
|
||||
--parti2(target_coords)
|
||||
end
|
||||
|
||||
-- TPJ
|
||||
function tpj_teleport_player(player)
|
||||
local pname = minetest.get_player_by_name(player)
|
||||
minetest.sound_play("whoosh", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10})
|
||||
pname:set_pos(find_free_position_near(target_coords))
|
||||
minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10})
|
||||
--parti2(target_coords)
|
||||
end
|
||||
|
||||
-- TPC
|
||||
-- TPC & TPJ
|
||||
function tpc_teleport_player(player)
|
||||
local pname = minetest.get_player_by_name(player)
|
||||
minetest.sound_play("whoosh", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10})
|
||||
@ -338,7 +329,7 @@ function tpj(player, param)
|
||||
minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!"))
|
||||
return
|
||||
end
|
||||
tpj_teleport_player(player)
|
||||
tpc_teleport_player(player)
|
||||
end
|
||||
|
||||
-- Evade
|
||||
|
Loading…
Reference in New Issue
Block a user