Fix missing attribute and imprecise message

This commit is contained in:
agaran 2018-07-07 16:33:55 +02:00 committed by Ezhh
parent 8d821607a8
commit 74ef3b8ad3

View File

@ -228,7 +228,7 @@ minetest.register_chatcommand("curses",{
func = function(user_name, target_name) func = function(user_name, target_name)
local player = minetest.get_player_by_name(target_name) local player = minetest.get_player_by_name(target_name)
if player == nil then if player == nil then
return false, "Player does not exist." return false, "Player does not exist or is not logged in."
end end
local result = "Status for player "..target_name..": " local result = "Status for player "..target_name..": "
local status_list = {"hobbled", "slowed", "frozen", "lost", "blind", "caged"} local status_list = {"hobbled", "slowed", "frozen", "lost", "blind", "caged"}
@ -237,7 +237,7 @@ minetest.register_chatcommand("curses",{
result = result..status_list[i].." " result = result..status_list[i].." "
end end
end end
if player:get_attribute("slowed") ~= "" then if player:get_attribute("slowed") and player:get_attribute("slowed") ~= "" then
result = result.."slowed("..player:get_attribute("slowed")..")" result = result.."slowed("..player:get_attribute("slowed")..")"
end end
minetest.chat_send_player(user_name, result.." Sneak mode: "..player:get_attribute("sneak_mode")) minetest.chat_send_player(user_name, result.." Sneak mode: "..player:get_attribute("sneak_mode"))