1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Debug tweaks

This commit is contained in:
AlexVinS 2016-02-10 08:59:24 +03:00
parent 3c78f960cd
commit fb17914ae5
3 changed files with 8 additions and 1 deletions

View File

@ -386,7 +386,9 @@ void CGObjectInstance::writeOwner(JsonNode & json) const
void CGObjectInstance::readOwner(const JsonNode & json)
{
if(json["owner"].getType() == JsonNode::DATA_STRING)
{
tempOwner = PlayerColor(vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, json["owner"].String()));
}
}
CGObjectInstanceBySubIdFinder::CGObjectInstanceBySubIdFinder(CGObjectInstance * obj) : obj(obj)

View File

@ -244,6 +244,7 @@ si32 CMapLoaderJson::getIdentifier(const std::string& type, const std::string& n
std::unique_ptr<CMap> CMapLoaderJson::loadMap()
{
LOG_TRACE(logGlobal);
map = new CMap();
mapHeader = std::unique_ptr<CMapHeader>(dynamic_cast<CMapHeader *>(map));
readMap();
@ -252,6 +253,7 @@ std::unique_ptr<CMap> CMapLoaderJson::loadMap()
std::unique_ptr<CMapHeader> CMapLoaderJson::loadMapHeader()
{
LOG_TRACE(logGlobal);
mapHeader.reset(new CMapHeader);
readHeader();
return std::move(mapHeader);
@ -274,6 +276,7 @@ const JsonNode CMapLoaderJson::readJson(const std::string & archiveFilename)
void CMapLoaderJson::readMap()
{
LOG_TRACE(logGlobal);
readHeader();
map->initTerrain();
readTerrain();
@ -575,11 +578,13 @@ void CMapLoaderJson::MapObjectLoader::construct()
if(typeName.empty())
{
logGlobal->errorStream() << "Object type missing";
logGlobal->traceStream() << configuration;
return;
}
if(subTypeName.empty())
{
logGlobal->errorStream() << "Object subType missing";
logGlobal->traceStream() << configuration;
return;
}

View File

@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(CMapFormatVCMI_Simple)
#if 1
{
auto path = VCMIDirs::get().userDataPath()/"test.zip";
auto path = VCMIDirs::get().userDataPath()/"test.vmap";
boost::filesystem::remove(path);
boost::filesystem::ofstream tmp(path, boost::filesystem::ofstream::binary);