1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-13 11:40:38 +02:00
This commit is contained in:
AlexVinS 2016-02-22 04:53:14 +03:00
parent 64cb0267a3
commit ac281f3fec
3 changed files with 8 additions and 4 deletions

View File

@ -141,7 +141,6 @@ CGObjectInstance::~CGObjectInstance()
const std::string & CGObjectInstance::getStringId() const
{
//todo: getStringId use real object type
if(stringId == "")
{
boost::format fmt("%s_%d");

View File

@ -186,7 +186,7 @@ public:
}
}
///Entry point of Json serialization
///Entry point of Json (de-)serialization
void serializeJson(JsonSerializeFormat & handler);
protected:

View File

@ -762,7 +762,7 @@ void CMapLoaderJson::MapObjectLoader::construct()
if(typeName.empty())
{
logGlobal->errorStream() << "Object type missing";
logGlobal->traceStream() << configuration;
logGlobal->debugStream() << configuration;
return;
}
@ -780,7 +780,7 @@ void CMapLoaderJson::MapObjectLoader::construct()
else if(subTypeName.empty())
{
logGlobal->errorStream() << "Object subType missing";
logGlobal->traceStream() << configuration;
logGlobal->debugStream() << configuration;
return;
}
@ -861,6 +861,11 @@ void CMapLoaderJson::readObjects()
//configure objects after all objects are constructed so we may resolve internal IDs even to actual pointers OTF
for(auto & ptr : loaders)
ptr->configure();
std::sort(map->heroesOnMap.begin(), map->heroesOnMap.end(), [](const ConstTransitivePtr<CGHeroInstance> & a, const ConstTransitivePtr<CGHeroInstance> & b)
{
return a->subID < b->subID;
});
}
///CMapSaverJson