mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 06:13:17 -04:00
Fix crash if /home
executed in irc, discord, etc
Running /home by any player in remote chat utilities(for example IRC, discordmt) was crashing the server if the player with the same name is not on the server
This commit is contained in:
parent
99a7193095
commit
26ca869cfa
1 changed files with 3 additions and 0 deletions
|
@ -52,6 +52,9 @@ end
|
||||||
|
|
||||||
sethome.get = function(name)
|
sethome.get = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
local player_meta = player:get_meta()
|
local player_meta = player:get_meta()
|
||||||
local pos = minetest.string_to_pos(player_meta:get_string("sethome:home"))
|
local pos = minetest.string_to_pos(player_meta:get_string("sethome:home"))
|
||||||
if pos then
|
if pos then
|
||||||
|
|
Loading…
Add table
Reference in a new issue