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:
parent
f1364b1e0b
commit
4125ce877d
3 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue