mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Change naming convention to be modname:* instead of modname_* (sorry modders!)
This commit is contained in:
parent
1c785c32ef
commit
760416b81f
4 changed files with 39 additions and 28 deletions
|
@ -153,11 +153,18 @@ void check_modname_prefix(lua_State *L, std::string &name)
|
|||
// For __builtin, anything goes
|
||||
if(modname == "__builtin")
|
||||
return;
|
||||
|
||||
if(name.substr(0, modname.size()+1) != modname + "_")
|
||||
|
||||
if(name.substr(0, modname.size()+1) != modname + ":")
|
||||
throw LuaError(L, std::string("Name \"")+name
|
||||
+"\" does not follow naming conventions: "
|
||||
+"\"modname_\" or \":\" prefix required)");
|
||||
+"\"modname:\" or \":\" prefix required)");
|
||||
|
||||
std::string subname = name.substr(modname.size()+1);
|
||||
if(!string_allowed(subname, "abcdefghijklmnopqrstuvwxyz"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"))
|
||||
throw LuaError(L, std::string("Name \"")+name
|
||||
+"\" does not follow naming conventions: "
|
||||
+"\"contains unallowed characters)");
|
||||
}
|
||||
|
||||
static v3f readFloatPos(lua_State *L, int index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue