From: Perttu Ahola Date: Fri, 13 Apr 2012 14:20:43 +0000 (+0300) Subject: Fix executing register_chatcommand-defined commands even in the middle of a chat... X-Git-Tag: 0.4.dev-20120603~46 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=24603d7ad3421284246116656abb533098a24631;p=oweals%2Fminetest.git Fix executing register_chatcommand-defined commands even in the middle of a chat line --- diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index e5d31c6aa..7845c7083 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -14,7 +14,7 @@ function minetest.register_chatcommand(cmd, def) end minetest.register_on_chat_message(function(name, message) - local cmd, param = string.match(message, "/([^ ]+) *(.*)") + local cmd, param = string.match(message, "^/([^ ]+) *(.*)") if not param then param = "" end