mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Add error message
This commit is contained in:
parent
71402ffcd2
commit
ba697c0d33
2 changed files with 8 additions and 2 deletions
|
@ -175,7 +175,8 @@ local function create_world_formspec(dialogdata)
|
|||
if not is_internal_mapgen then
|
||||
-- Select singlenode if using lua-defined mapgen
|
||||
-- Here we have to make sure it doesn't override an internal mapgen
|
||||
if lua_mapgens[current_mapgen_internal] ~= nil and (current_mapgen == dialogdata.mg or lua_mapgens[current_mapgen_internal].title == dialogdata.mg) then
|
||||
if lua_mapgens[current_mapgen_internal] ~= nil and
|
||||
(current_mapgen == dialogdata.mg or lua_mapgens[current_mapgen_internal].title == dialogdata.mg) then
|
||||
current_mapgen_internal = "singlenode"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -132,16 +132,21 @@ void ModConfiguration::addMapgenFromConfig(
|
|||
*
|
||||
* If the mod is enabled, add it to `mapgen_mod` and break
|
||||
*/
|
||||
bool mapgen_found = false;
|
||||
for (const auto &mapgenPath : mapgenPaths) {
|
||||
std::vector<ModSpec> addon_mods_in_path = flattenMods(getModsInPath(mapgenPath.second, mapgenPath.first));
|
||||
for (const auto &mod : addon_mods_in_path) {
|
||||
if (mod.name == mapgen) {
|
||||
mapgen_mod.push_back(mod);
|
||||
mapgen_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!mapgen_found) {
|
||||
throw ModError("This world is configured to use a lua-defined mapgen: '" + mapgen + "' must be installed to load this world.");
|
||||
} else
|
||||
addMods(mapgen_mod);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue