mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-16 09:55:22 +02:00
Mods: Combine mod loading checks and deprection logging (#11503)
This limits the logged deprecation messages to the mods that are loaded Unifies the mod naming convention check for CSM & SSM
This commit is contained in:
@@ -61,12 +61,8 @@ void ServerModManager::loadMods(ServerScripting *script)
|
||||
infostream << std::endl;
|
||||
// Load and run "mod" scripts
|
||||
for (const ModSpec &mod : m_sorted_mods) {
|
||||
if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) {
|
||||
throw ModError("Error loading mod \"" + mod.name +
|
||||
"\": Mod name does not follow naming "
|
||||
"conventions: "
|
||||
"Only characters [a-z0-9_] are allowed.");
|
||||
}
|
||||
mod.checkAndLog();
|
||||
|
||||
std::string script_path = mod.path + DIR_DELIM + "init.lua";
|
||||
auto t = porting::getTimeMs();
|
||||
script->loadMod(script_path, mod.name);
|
||||
|
Reference in New Issue
Block a user