mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Bugfixing
This commit is contained in:
@@ -230,7 +230,6 @@
|
|||||||
"subterraneanGate" : {
|
"subterraneanGate" : {
|
||||||
"index" :103,
|
"index" :103,
|
||||||
"handler" : "subterraneanGate",
|
"handler" : "subterraneanGate",
|
||||||
"lastReservedIndex" : 1,
|
|
||||||
"base" : {
|
"base" : {
|
||||||
"sounds" : {
|
"sounds" : {
|
||||||
"ambient" : ["LOOPGATE"],
|
"ambient" : ["LOOPGATE"],
|
||||||
@@ -239,8 +238,8 @@
|
|||||||
},
|
},
|
||||||
"types" : {
|
"types" : {
|
||||||
"object" : {
|
"object" : {
|
||||||
"index" : 0 },
|
"index" : 0
|
||||||
"objectWoG" : { "index" : 1 } // WoG object? Present on VCMI Test 2011b
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -342,9 +341,6 @@
|
|||||||
"value" : 3000,
|
"value" : 3000,
|
||||||
"rarity" : 100
|
"rarity" : 100
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"object1":{ //WoG?
|
|
||||||
"index" :1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -560,7 +556,6 @@
|
|||||||
"witchHut" : {
|
"witchHut" : {
|
||||||
"index" :113,
|
"index" :113,
|
||||||
"handler" : "witch",
|
"handler" : "witch",
|
||||||
"lastReservedIndex" : 1,
|
|
||||||
"base" : {
|
"base" : {
|
||||||
"sounds" : {
|
"sounds" : {
|
||||||
"visit" : ["GAZEBO"]
|
"visit" : ["GAZEBO"]
|
||||||
@@ -575,9 +570,6 @@
|
|||||||
"value" : 1500,
|
"value" : 1500,
|
||||||
"rarity" : 80
|
"rarity" : 80
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"object1" : { //WoG?
|
|
||||||
"index" : 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1044,10 +1036,10 @@
|
|||||||
"grassHills" : { "index" :208, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
"grassHills" : { "index" :208, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
||||||
"roughHills" : { "index" :209, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
"roughHills" : { "index" :209, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
||||||
"subterraneanRocks" : { "index" :210, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
"subterraneanRocks" : { "index" :210, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
||||||
"swampFoliage" : { "index" :211, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
"swampFoliage" : { "index" :211, "handler": "static", "types" : { "object" : { "index" : 0} } }
|
||||||
|
|
||||||
//These are WoG objects? They are not available in H3
|
//These are WoG objects? They are not available in H3
|
||||||
"frozenLakeDUPLICATE" : { "index" :172, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
//"frozenLakeDUPLICATE" : { "index" :172, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
||||||
"oakTreesDUPLICATE" : { "index" :186, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
//"oakTreesDUPLICATE" : { "index" :186, "handler": "static", "types" : { "object" : { "index" : 0} } },
|
||||||
"plant" : { "index" :189, "handler": "static", "types" : { "object" : { "index" : 0} } }
|
//"plant" : { "index" :189, "handler": "static", "types" : { "object" : { "index" : 0} } }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,20 @@
|
|||||||
"$schema": "http://json-schema.org/draft-04/schema",
|
"$schema": "http://json-schema.org/draft-04/schema",
|
||||||
"title" : "VCMI map object format",
|
"title" : "VCMI map object format",
|
||||||
"description" : "Description of map object class",
|
"description" : "Description of map object class",
|
||||||
"required": [ "handler", "name" ],
|
"required": [ "handler" ],
|
||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
|
|
||||||
"properties":{
|
"properties":{
|
||||||
"index": {
|
"index": {
|
||||||
"type":"number"
|
"type":"number"
|
||||||
},
|
},
|
||||||
|
"lastReservedIndex" : {
|
||||||
|
"type":"number"
|
||||||
|
},
|
||||||
|
"subObjects" : {
|
||||||
|
"type" : "array",
|
||||||
|
"additionalItems" : true
|
||||||
|
},
|
||||||
"handler": {
|
"handler": {
|
||||||
"type":"string"
|
"type":"string"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"$schema": "http://json-schema.org/draft-04/schema",
|
"$schema": "http://json-schema.org/draft-04/schema",
|
||||||
"title" : "VCMI map object type format",
|
"title" : "VCMI map object type format",
|
||||||
"description" : "Description of map object type, used only as sub-schema of object",
|
"description" : "Description of map object type, used only as sub-schema of object",
|
||||||
"required": [ ],
|
"required": [ "name" ],
|
||||||
"additionalProperties" : true, // may have type-dependant properties
|
"additionalProperties" : true, // may have type-dependant properties
|
||||||
|
|
||||||
"properties":{
|
"properties":{
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
"aiValue": {
|
"aiValue": {
|
||||||
"type":"number"
|
"type":"number"
|
||||||
},
|
},
|
||||||
|
|
||||||
"sounds": {
|
"sounds": {
|
||||||
"type":"object",
|
"type":"object",
|
||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ std::vector<JsonNode> CObjectClassesHandler::loadLegacyData(size_t dataSize)
|
|||||||
legacyTemplates.insert(std::make_pair(key, std::shared_ptr<const ObjectTemplate>(tmpl)));
|
legacyTemplates.insert(std::make_pair(key, std::shared_ptr<const ObjectTemplate>(tmpl)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objects.resize(256);
|
||||||
|
|
||||||
std::vector<JsonNode> ret(dataSize);// create storage for 256 objects
|
std::vector<JsonNode> ret(dataSize);// create storage for 256 objects
|
||||||
assert(dataSize == 256);
|
assert(dataSize == 256);
|
||||||
|
|
||||||
@@ -251,6 +253,9 @@ void CObjectClassesHandler::loadSubObject(const std::string & identifier, JsonNo
|
|||||||
assert(ID < objects.size());
|
assert(ID < objects.size());
|
||||||
assert(objects[ID]);
|
assert(objects[ID]);
|
||||||
|
|
||||||
|
if ( subID >= objects[ID]->objects.size())
|
||||||
|
objects[ID]->objects.resize(subID+1);
|
||||||
|
|
||||||
JsonUtils::inherit(config, objects.at(ID)->base);
|
JsonUtils::inherit(config, objects.at(ID)->base);
|
||||||
loadSubObject(config.meta, identifier, config, objects[ID], subID);
|
loadSubObject(config.meta, identifier, config, objects[ID], subID);
|
||||||
}
|
}
|
||||||
@@ -343,6 +348,9 @@ void CObjectClassesHandler::afterLoadFinalization()
|
|||||||
|
|
||||||
for(auto obj : entry->objects)
|
for(auto obj : entry->objects)
|
||||||
{
|
{
|
||||||
|
if (!obj)
|
||||||
|
continue;
|
||||||
|
|
||||||
obj->afterLoadFinalization();
|
obj->afterLoadFinalization();
|
||||||
if(obj->getTemplates().empty())
|
if(obj->getTemplates().empty())
|
||||||
logGlobal->warn("No templates found for %s:%s", entry->getIdentifier(), obj->getIdentifier());
|
logGlobal->warn("No templates found for %s:%s", entry->getIdentifier(), obj->getIdentifier());
|
||||||
@@ -352,12 +360,9 @@ void CObjectClassesHandler::afterLoadFinalization()
|
|||||||
//duplicate existing two-way portals to make reserve for RMG
|
//duplicate existing two-way portals to make reserve for RMG
|
||||||
auto& portalVec = objects[Obj::MONOLITH_TWO_WAY]->objects;
|
auto& portalVec = objects[Obj::MONOLITH_TWO_WAY]->objects;
|
||||||
size_t portalCount = portalVec.size();
|
size_t portalCount = portalVec.size();
|
||||||
size_t currentIndex = portalCount;
|
|
||||||
while(portalVec.size() < 100)
|
for (size_t i = portalCount; i < 100; ++i)
|
||||||
{
|
portalVec.push_back(portalVec[static_cast<si32>(i % portalCount)]);
|
||||||
portalVec[(si32)currentIndex] = portalVec[static_cast<si32>(currentIndex % portalCount)];
|
|
||||||
currentIndex++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
|
std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
|
||||||
@@ -367,6 +372,9 @@ std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
|
|||||||
|
|
||||||
SObjectSounds CObjectClassesHandler::getObjectSounds(si32 type, si32 subtype) const
|
SObjectSounds CObjectClassesHandler::getObjectSounds(si32 type, si32 subtype) const
|
||||||
{
|
{
|
||||||
|
if(type == Obj::PRISON || type == Obj::HERO)
|
||||||
|
subtype = 0;
|
||||||
|
|
||||||
assert(type < objects.size());
|
assert(type < objects.size());
|
||||||
assert(objects[type]);
|
assert(objects[type]);
|
||||||
assert(subtype < objects[type]->objects.size());
|
assert(subtype < objects[type]->objects.size());
|
||||||
|
|||||||
Reference in New Issue
Block a user