From 238a93fcb353627b507315960b36a6152a7e93e9 Mon Sep 17 00:00:00 2001 From: nixnoxus Date: Tue, 26 Apr 2022 17:06:20 +0200 Subject: [PATCH] no leading spaces before punctuation marks --- mods/default/functions.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 427c56b8..d4f07fc7 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -737,7 +737,10 @@ function default.log_player_action(player, ...) and player.is_fake_player or "*").. ")" end for _, v in ipairs({...}) do - msg = msg .. " " .. (is_vector(v) and minetest.pos_to_string(v) or v) + -- translate vectors + local part = is_vector(v) and minetest.pos_to_string(v) or v + -- no leading spaces before punctuation marks + msg = msg .. (string.match(part, "^[;,.]") and "" or " ") .. part end minetest.log("action", msg) end