mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Ignore illegal 'index' entries in mods
This commit is contained in:
@ -115,11 +115,13 @@ bool ContentTypeHandler::loadMod(const std::string & modName, bool validate)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (vstd::contains(data.Struct(), "index") && !data["index"].isNull())
|
||||
{
|
||||
if (modName != "core")
|
||||
logMod->warn("Mod %s is attempting to load original data! This should be reserved for built-in mod.", modName);
|
||||
bool hasIndex = vstd::contains(data.Struct(), "index") && !data["index"].isNull();
|
||||
|
||||
if (hasIndex && modName != "core")
|
||||
logMod->error("Mod %s is attempting to load original data! This option is reserved for built-in mod.", modName);
|
||||
|
||||
if (hasIndex && modName == "core")
|
||||
{
|
||||
// try to add H3 object data
|
||||
size_t index = static_cast<size_t>(data["index"].Float());
|
||||
|
||||
|
Reference in New Issue
Block a user