mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fix initialization of visitDir in templates
This commit is contained in:
@@ -530,6 +530,11 @@
|
|||||||
"index" :20,
|
"index" :20,
|
||||||
"handler": "dwelling",
|
"handler": "dwelling",
|
||||||
"lastReservedIndex" : 1,
|
"lastReservedIndex" : 1,
|
||||||
|
"base" : {
|
||||||
|
"base" : {
|
||||||
|
"visitableFrom" : [ "---", "+++", "+++" ]
|
||||||
|
}
|
||||||
|
},
|
||||||
"types" : {
|
"types" : {
|
||||||
"elementalConflux" : {
|
"elementalConflux" : {
|
||||||
"index" : 0,
|
"index" : 0,
|
||||||
|
|||||||
@@ -359,14 +359,14 @@ void CObjectClassesHandler::beforeValidate(JsonNode & object)
|
|||||||
{
|
{
|
||||||
auto const & vector = object["subObjects"].Vector();
|
auto const & vector = object["subObjects"].Vector();
|
||||||
|
|
||||||
if (!entry.second.Struct().count("index"))
|
if (entry.second.Struct().count("index"))
|
||||||
continue;
|
{
|
||||||
|
|
||||||
size_t index = entry.second["index"].Integer();
|
size_t index = entry.second["index"].Integer();
|
||||||
|
|
||||||
if (index < vector.size())
|
if (index < vector.size())
|
||||||
JsonUtils::inherit(entry.second, vector[index]);
|
JsonUtils::inherit(entry.second, vector[index]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JsonUtils::inherit(entry.second, object["base"]);
|
JsonUtils::inherit(entry.second, object["base"]);
|
||||||
for (auto & templ : entry.second["templates"].Struct())
|
for (auto & templ : entry.second["templates"].Struct())
|
||||||
|
|||||||
@@ -559,6 +559,9 @@ void ObjectTemplate::recalculate()
|
|||||||
calculateBlockedOffsets();
|
calculateBlockedOffsets();
|
||||||
calculateBlockMapOffset();
|
calculateBlockMapOffset();
|
||||||
calculateVisitableOffset();
|
calculateVisitableOffset();
|
||||||
|
|
||||||
|
if (visitable && visitDir == 0)
|
||||||
|
logMod->warn("Template for %s is visitable but has no visitable directions!", animationFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
Reference in New Issue
Block a user