From 2a54ea6e74d4a909cda0b4fbd49dda21acf17f7c Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 26 Nov 2022 04:25:35 +0100 Subject: [PATCH] mcl_info: Allow debug field that's visible for everyone --- mods/HUD/mcl_info/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/HUD/mcl_info/init.lua b/mods/HUD/mcl_info/init.lua index 71f8d8ad09..8c93c14204 100644 --- a/mods/HUD/mcl_info/init.lua +++ b/mods/HUD/mcl_info/init.lua @@ -58,7 +58,7 @@ end local function get_text(player, bits) local pos = vector.offset(player:get_pos(),0,0.5,0) local bits = bits - if bits == 0 then return "" end + if bits == -1 then return "" end local r = "" for _,key in ipairs(fields_keyset) do @@ -115,15 +115,15 @@ minetest.register_on_leaveplayer(function(p) end) minetest.register_chatcommand("debug",{ - description = S("Set debug bit mask: 0 = disable, 1 = biome name, 2 = coordinates, 3 = all"), + description = S("Set debug bit mask: -1 = disable, 0 = player coords, 1 = biome name, 2 = coordinates, 3 = all"), params = S(""), privs = { debug = true }, func = function(name, params) local player = minetest.get_player_by_name(name) if params == "" then return true, "Debug bitmask is "..player_setting(player) end local dbg = math.floor(tonumber(params) or default_debug) - if dbg < 0 or dbg > 4 then - minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", 0, 4)) + if dbg < -1 or dbg > 4 then + minetest.chat_send_player(name, S("Error! Possible values are integer numbers from @1 to @2", -1, 4)) return false,"Current bitmask: "..player_setting(player) end return true, "Debug bit mask set to "..player_setting(player,dbg)