mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Try to detect corrupted mod earlier
This commit is contained in:
parent
017aaefc40
commit
52840afb24
@ -648,7 +648,7 @@ CCreature * CCreatureHandler::loadFromJson(const std::string & scope, const Json
|
|||||||
JsonNode advMapFile = node["graphics"]["map"];
|
JsonNode advMapFile = node["graphics"]["map"];
|
||||||
JsonNode advMapMask = node["graphics"]["mapMask"];
|
JsonNode advMapMask = node["graphics"]["mapMask"];
|
||||||
|
|
||||||
VLC->identifiers()->requestIdentifier(scope, "object", "monster", [=](si32 index)
|
VLC->identifiers()->requestIdentifier(scope, "object", "monster", [cre, scope, advMapFile, advMapMask](si32 index)
|
||||||
{
|
{
|
||||||
JsonNode conf;
|
JsonNode conf;
|
||||||
conf.setModScope(scope);
|
conf.setModScope(scope);
|
||||||
@ -669,7 +669,12 @@ CCreature * CCreatureHandler::loadFromJson(const std::string & scope, const Json
|
|||||||
|
|
||||||
// object does not have any templates - this is not usable object (e.g. pseudo-creature like Arrow Tower)
|
// object does not have any templates - this is not usable object (e.g. pseudo-creature like Arrow Tower)
|
||||||
if (VLC->objtypeh->getHandlerFor(Obj::MONSTER, cre->getId().num)->getTemplates().empty())
|
if (VLC->objtypeh->getHandlerFor(Obj::MONSTER, cre->getId().num)->getTemplates().empty())
|
||||||
|
{
|
||||||
|
assert(cre->special);
|
||||||
|
if (!cre->special)
|
||||||
|
logMod->error("Creature %s does not have valid map object but is not marked as special!", cre->getJsonKey());
|
||||||
VLC->objtypeh->removeSubObject(Obj::MONSTER, cre->getId().num);
|
VLC->objtypeh->removeSubObject(Obj::MONSTER, cre->getId().num);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return cre;
|
return cre;
|
||||||
|
Loading…
Reference in New Issue
Block a user