Commands: restricted command name to have only [a-z, A-Z, 0-9, _] chars

This commit is contained in:
bi 2018-06-08 13:29:49 +03:00
parent f6c62a949a
commit 977ec7558f

View file

@ -22,9 +22,8 @@ VMFMod.command = function (self, command_name, command_description, command_func
return return
end end
if string.find(command_name, " ") then if string.match(command_name, "[^%w_]") then
self:error("(command) '%s': command name can contain only [a-z, A-Z, 0-9, _] characters", command_name)
self:error("(command): command name can't contain spaces: [%s]", command_name)
return return
end end