Consistent error messages

This commit is contained in:
Lars Müller 2022-12-20 18:39:10 +01:00 committed by GitHub
parent dc845b9f3e
commit 44dd4d00dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ 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 if not player then
return nil return false, S("This command can only be executed in-game!")
end 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"))
@ -91,7 +91,7 @@ minetest.register_chatcommand("home", {
func = function(name) func = function(name)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
if not player then if not player then
return false, S("This command can be executed in-game only!") return false, S("This command can only be executed in-game!")
end end
if sethome.go(name) then if sethome.go(name) then
return true, S("Teleported to home!") return true, S("Teleported to home!")