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