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:
parent
ac8de2173a
commit
6c1d3ce8fa
1 changed files with 3 additions and 3 deletions
|
@ -267,9 +267,9 @@ void ScriptApiBase::loadMod(const std::string &script_path,
|
||||||
const std::string &mod_name)
|
const std::string &mod_name)
|
||||||
{
|
{
|
||||||
if (!fs::IsFile(script_path)) {
|
if (!fs::IsFile(script_path)) {
|
||||||
errorstream << "Mod error: Failed to load mod \"" << mod_name
|
throw ModError("Failed to load mod \"" + mod_name
|
||||||
<< "\" as script \"" << script_path << "\" does not exist" << std::endl;
|
+ "\" as it's initialization script at \"" + script_path
|
||||||
return;
|
+ "\" does not exist. Try to reinstall/update mod or disable it.");
|
||||||
}
|
}
|
||||||
ModNameStorer mod_name_storer(getStack(), mod_name);
|
ModNameStorer mod_name_storer(getStack(), mod_name);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue