|
@@ -577,18 +577,18 @@ int LuaInterface::lua_dofile(lua_State* L)
|
577
|
577
|
|
578
|
578
|
int LuaInterface::lua_dofiles(lua_State* L)
|
579
|
579
|
{
|
580
|
|
- bool recursive = false;
|
|
580
|
+ std::string contains = "";
|
581
|
581
|
if(g_lua.getTop() > 2) {
|
582
|
|
- recursive = g_lua.popBoolean();
|
|
582
|
+ contains = g_lua.popString();
|
583
|
583
|
}
|
584
|
584
|
|
585
|
|
- std::string contains = "";
|
|
585
|
+ bool recursive = false;
|
586
|
586
|
if(g_lua.getTop() > 1) {
|
587
|
|
- contains = g_lua.popString();
|
|
587
|
+ recursive = g_lua.popBoolean();
|
588
|
588
|
}
|
589
|
589
|
|
590
|
590
|
std::string directory = g_lua.popString();
|
591
|
|
- g_lua.loadFiles(directory, contains, recursive);
|
|
591
|
+ g_lua.loadFiles(directory, recursive, contains);
|
592
|
592
|
|
593
|
593
|
return 0;
|
594
|
594
|
}
|
|
@@ -1247,13 +1247,13 @@ int LuaInterface::getTop()
|
1247
|
1247
|
return lua_gettop(L);
|
1248
|
1248
|
}
|
1249
|
1249
|
|
1250
|
|
-void LuaInterface::loadFiles(std::string directory, std::string contains, bool recursive)
|
|
1250
|
+void LuaInterface::loadFiles(std::string directory, bool recursive, std::string contains)
|
1251
|
1251
|
{
|
1252
|
1252
|
for(const std::string& fileName : g_resources.listDirectoryFiles(directory)) {
|
1253
|
1253
|
std::string fullPath = directory + "/" + fileName;
|
1254
|
1254
|
|
1255
|
1255
|
if(recursive && g_resources.directoryExists(fullPath)) {
|
1256
|
|
- loadFiles(fullPath, contains, true);
|
|
1256
|
+ loadFiles(fullPath, true, contains);
|
1257
|
1257
|
continue;
|
1258
|
1258
|
}
|
1259
|
1259
|
|