mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-29 04:00:24 +01:00
Fix teleport sounds when teleport fails (#155)
This commit is contained in:
parent
04b2edceb4
commit
f25426911d
2
api.lua
2
api.lua
@ -188,7 +188,9 @@ function unified_inventory.go_home(player)
|
||||
local pos = unified_inventory.home_pos[player:get_player_name()]
|
||||
if pos then
|
||||
player:set_pos(pos)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- register_craft
|
||||
|
@ -76,9 +76,9 @@ unified_inventory.register_button("home_gui_go", {
|
||||
action = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
if minetest.check_player_privs(player_name, {home=true}) then
|
||||
minetest.sound_play("teleport",
|
||||
{to_player=player:get_player_name(), gain = 1.0})
|
||||
unified_inventory.go_home(player)
|
||||
if unified_inventory.go_home(player) then
|
||||
minetest.sound_play("teleport", {to_player = player_name})
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(player_name,
|
||||
S("You don't have the \"home\" privilege!"))
|
||||
|
Loading…
Reference in New Issue
Block a user