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

Trow mod error exception if given init script doesn't exist on mod loading

This commit is contained in:
ZavGaro 2024-08-21 09:42:46 +03:00
parent ac8de2173a
commit 6c1d3ce8fa

View file

@ -267,9 +267,9 @@ void ScriptApiBase::loadMod(const std::string &script_path,
const std::string &mod_name)
{
if (!fs::IsFile(script_path)) {
errorstream << "Mod error: Failed to load mod \"" << mod_name
<< "\" as script \"" << script_path << "\" does not exist" << std::endl;
return;
throw ModError("Failed to load mod \"" + mod_name
+ "\" as it's initialization script at \"" + script_path
+ "\" does not exist. Try to reinstall/update mod or disable it.");
}
ModNameStorer mod_name_storer(getStack(), mod_name);