1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +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 const std::string & CGObjectInstance::getStringId() const
{ {
//todo: getStringId use real object type
if(stringId == "") if(stringId == "")
{ {
boost::format fmt("%s_%d"); 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); void serializeJson(JsonSerializeFormat & handler);
protected: protected:

View File

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