mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Improvements for json validation for mods
- Implemented validation for `targetCondition` in spells - Implemented validation for `mapObject` in towns/heroes - Fixed validation of zone connections in RMG - Added workarounds to prevent assertions triggering on invalid mods - Erase 'base' entries from json before validation (but after applying them to derived keys) Should have no effect on mod behavior/support, but may cause new detections for mods that were broken in either 1.6 or 1.7
This commit is contained in:
@@ -123,9 +123,9 @@ std::shared_ptr<CHeroClass> CHeroClassHandler::loadFromJson(const std::string &
|
||||
LIBRARY->identifiers()->requestIdentifier(scope, "object", "hero", [=](si32 index) {
|
||||
JsonNode classConf = node["mapObject"];
|
||||
classConf["heroClass"].String() = identifier;
|
||||
classConf["heroClass"].setModScope(scope);
|
||||
if (!node["compatibilityIdentifiers"].isNull())
|
||||
classConf["compatibilityIdentifiers"] = node["compatibilityIdentifiers"];
|
||||
classConf.setModScope(scope);
|
||||
LIBRARY->objtypeh->loadSubObject(identifier, classConf, index, heroClass->getIndex());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user