1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Do not discover mod directories that fail parsing (#15917)

The root issue of the unit test failure is that all directories that are found in the mod search are counted as mods, even if they are detected to be invalid as such by the parser. For example, the presence of an init.lua file is required, and the parser will return false if one is not found. This return value was completely ignored. Simply counting the mod conditionally on the parsing success makes the modserver tests pass on MSVC.
This commit is contained in:
JosiahWI 2025-03-19 12:43:19 -05:00 committed by GitHub
parent f1364b1e0b
commit 4125ce877d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -385,7 +385,8 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
if (spec.type == "mod") {
ModSpec spec;
spec.path = path;
parseModContents(spec);
// TODO return nothing on failure (needs callers to handle it)
static_cast<void>(parseModContents(spec));
// Dependencies
lua_newtable(L);