mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Fix minor bugs
This commit is contained in:
@ -1479,7 +1479,10 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
|
|||||||
if(portrait >= 0)
|
if(portrait >= 0)
|
||||||
{
|
{
|
||||||
if(portrait < legacyHeroes || portrait >= moddedStart)
|
if(portrait < legacyHeroes || portrait >= moddedStart)
|
||||||
handler.serializeId<si32, si32, HeroTypeID>("portrait", portrait, -1);
|
{
|
||||||
|
int tempPortrait = portrait - GameConstants::HERO_PORTRAIT_SHIFT;
|
||||||
|
handler.serializeId<si32, si32, HeroTypeID>("portrait", tempPortrait, -1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
handler.serializeInt("portrait", portrait, -1);
|
handler.serializeInt("portrait", portrait, -1);
|
||||||
}
|
}
|
||||||
@ -1489,7 +1492,10 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
|
|||||||
const JsonNode & portraitNode = handler.getCurrent()["portrait"];
|
const JsonNode & portraitNode = handler.getCurrent()["portrait"];
|
||||||
|
|
||||||
if(portraitNode.getType() == JsonNode::JsonType::DATA_STRING)
|
if(portraitNode.getType() == JsonNode::JsonType::DATA_STRING)
|
||||||
|
{
|
||||||
handler.serializeId<si32, si32, HeroTypeID>("portrait", portrait, -1);
|
handler.serializeId<si32, si32, HeroTypeID>("portrait", portrait, -1);
|
||||||
|
portrait += GameConstants::HERO_PORTRAIT_SHIFT;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
handler.serializeInt("portrait", portrait, -1);
|
handler.serializeInt("portrait", portrait, -1);
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ CCampaignScenario CCampaignHandler::readScenarioFromJson(JsonNode & reader)
|
|||||||
CCampaignScenario ret;
|
CCampaignScenario ret;
|
||||||
ret.conquered = false;
|
ret.conquered = false;
|
||||||
ret.mapName = reader["map"].String();
|
ret.mapName = reader["map"].String();
|
||||||
for(auto & g : reader["precoditions"].Vector())
|
for(auto & g : reader["preconditions"].Vector())
|
||||||
ret.preconditionRegions.insert(g.Integer());
|
ret.preconditionRegions.insert(g.Integer());
|
||||||
|
|
||||||
ret.regionColor = reader["color"].Integer();
|
ret.regionColor = reader["color"].Integer();
|
||||||
|
@ -576,6 +576,9 @@ ModCompatibilityInfo MapController::modAssessmentMap(const CMap & map)
|
|||||||
ModCompatibilityInfo result;
|
ModCompatibilityInfo result;
|
||||||
for(auto obj : map.objects)
|
for(auto obj : map.objects)
|
||||||
{
|
{
|
||||||
|
if(obj->ID == Obj::HERO)
|
||||||
|
continue; //stub!
|
||||||
|
|
||||||
auto handler = VLC->objtypeh->getHandlerFor(obj->ID, obj->subID);
|
auto handler = VLC->objtypeh->getHandlerFor(obj->ID, obj->subID);
|
||||||
auto modName = QString::fromStdString(handler->getJsonKey()).split(":").at(0).toStdString();
|
auto modName = QString::fromStdString(handler->getJsonKey()).split(":").at(0).toStdString();
|
||||||
if(modName != "core")
|
if(modName != "core")
|
||||||
|
Reference in New Issue
Block a user