mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Tweaks
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user