small comand build in fixesd: no new line checks

This commit is contained in:
mckaygerhard 2023-09-17 21:18:28 -04:00
parent d32f4b368c
commit dd90cad8b5
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,10 @@
core.chatcommands = core.registered_chatcommands -- BACKWARDS COMPATIBILITY
core.register_on_chat_message(function(name, message)
if message:sub(1,1) ~= "/" then
if message:find("[\r\n]") then
core.chat_send_player(name, "You cannot use newlines in chat messages.")
return true
elseif message:sub(1,1) ~= "/" then
return
end

View File

@ -402,6 +402,8 @@ function modmgr.preparemodlist(data)
if modpath ~= nil and
modpath ~= "" then
get_mods(modpath,global_mods)
else
get_mods("/usr/share/games/minetest/mods",global_mods)
end
for i=1,#global_mods,1 do