Optional dependencies and properly handle mod name conflicts again

This commit is contained in:
Kahrl
2013-05-03 23:58:22 +02:00
parent a031a15487
commit 969d2b3eb1
6 changed files with 324 additions and 169 deletions

View File

@@ -76,8 +76,7 @@ bool scriptapi_loadmod(lua_State *L, const std::string &scriptpath,
{
ModNameStorer modnamestorer(L, modname);
if(!string_allowed(modname, "abcdefghijklmnopqrstuvwxyz"
"0123456789_")){
if(!string_allowed(modname, MODNAME_ALLOWED_CHARS)){
errorstream<<"Error loading mod \""<<modname
<<"\": modname does not follow naming conventions: "
<<"Only chararacters [a-z0-9_] are allowed."<<std::endl;