mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Add luacheck to check builtin (#7895)
This commit is contained in:
parent
8da35c22d1
commit
8e757859d6
24 changed files with 202 additions and 140 deletions
|
@ -16,7 +16,7 @@ core.register_on_sending_chat_message(function(message)
|
|||
end
|
||||
|
||||
local cmd, param = string.match(message, "^%.([^ ]+) *(.*)")
|
||||
param = param or ""
|
||||
param = param or ""
|
||||
|
||||
if not cmd then
|
||||
core.display_chat_message(core.gettext("-!- Empty command"))
|
||||
|
@ -26,9 +26,9 @@ core.register_on_sending_chat_message(function(message)
|
|||
local cmd_def = core.registered_chatcommands[cmd]
|
||||
if cmd_def then
|
||||
core.set_last_run_mod(cmd_def.mod_origin)
|
||||
local _, message = cmd_def.func(param)
|
||||
if message then
|
||||
core.display_chat_message(message)
|
||||
local _, result = cmd_def.func(param)
|
||||
if result then
|
||||
core.display_chat_message(result)
|
||||
end
|
||||
else
|
||||
core.display_chat_message(core.gettext("-!- Invalid command: ") .. cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue