Disable calling require with file extension for lua_scripts folder

This commit is contained in:
Rochet2
2017-08-03 17:13:04 +03:00
parent 86a0ae93f0
commit 0f4f2c35db

View File

@@ -355,7 +355,7 @@ void Eluna::AddScriptPath(std::string filename, const std::string& fullpath)
filename = filename.substr(0, extDot); filename = filename.substr(0, extDot);
// check extension and add path to scripts to load // check extension and add path to scripts to load
if (ext != ".lua" && ext != ".dll" && ext != ".ext") if (ext != ".lua" && ext != ".dll" && ext != ".so" && ext != ".ext")
return; return;
bool extension = ext == ".ext"; bool extension = ext == ".ext";
@@ -383,7 +383,6 @@ void Eluna::GetScripts(std::string path)
if (boost::filesystem::exists(someDir) && boost::filesystem::is_directory(someDir)) if (boost::filesystem::exists(someDir) && boost::filesystem::is_directory(someDir))
{ {
lua_requirepath += lua_requirepath +=
path + "/?;" +
path + "/?.lua;" + path + "/?.lua;" +
path + "/?.ext;" + path + "/?.ext;" +
path + "/?.dll;" + path + "/?.dll;" +
@@ -425,7 +424,6 @@ void Eluna::GetScripts(std::string path)
return; return;
lua_requirepath += lua_requirepath +=
path + "/?;" +
path + "/?.lua;" + path + "/?.lua;" +
path + "/?.ext;" + path + "/?.ext;" +
path + "/?.dll;" + path + "/?.dll;" +