accept .luac as valid lua files
This commit is contained in:
parent
2bf4386928
commit
595d3aec9a
|
@ -13,7 +13,7 @@ size_t mod_get_lua_size(struct Mod* mod) {
|
|||
|
||||
for (int i = 0; i < mod->fileCount; i++) {
|
||||
struct ModFile* file = &mod->files[i];
|
||||
if (!str_ends_with(file->relativePath, ".lua")) { continue; }
|
||||
if (!(str_ends_with(file->relativePath, ".lua") || str_ends_with(file->relativePath, ".luac"))) { continue; }
|
||||
size += file->size;
|
||||
}
|
||||
|
||||
|
@ -318,7 +318,7 @@ static bool mod_load_files(struct Mod* mod, char* modName, char* fullPath) {
|
|||
|
||||
// deal with mod directory
|
||||
{
|
||||
const char* fileTypes[] = { ".lua", NULL };
|
||||
const char* fileTypes[] = { ".lua", ".luac", NULL };
|
||||
if (!mod_load_files_dir(mod, fullPath, "", fileTypes)) { return false; }
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (str_ends_with(file_stat.m_filename, ".lua")) {
|
||||
if (str_ends_with(file_stat.m_filename, ".lua") || str_ends_with(file_stat.m_filename, ".luac")) {
|
||||
path_get_folder(file_stat.m_filename, luaPath);
|
||||
*isLua = true;
|
||||
break;
|
||||
|
@ -214,7 +214,7 @@ bool mod_import_file(char* path) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (str_ends_with(path, ".lua")) {
|
||||
if (str_ends_with(path, ".lua") || str_ends_with(path, ".luac")) {
|
||||
isLua = true;
|
||||
ret = mod_import_lua(path);
|
||||
} else if (str_ends_with(path, ".zip")) {
|
||||
|
|
Loading…
Reference in New Issue