|
@@ -1479,7 +1479,10 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
|
|
|
if(portrait >= 0)
|
|
|
{
|
|
|
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
|
|
|
handler.serializeInt("portrait", portrait, -1);
|
|
|
}
|
|
@@ -1489,7 +1492,10 @@ void CGHeroInstance::serializeCommonOptions(JsonSerializeFormat & handler)
|
|
|
const JsonNode & portraitNode = handler.getCurrent()["portrait"];
|
|
|
|
|
|
if(portraitNode.getType() == JsonNode::JsonType::DATA_STRING)
|
|
|
+ {
|
|
|
handler.serializeId<si32, si32, HeroTypeID>("portrait", portrait, -1);
|
|
|
+ portrait += GameConstants::HERO_PORTRAIT_SHIFT;
|
|
|
+ }
|
|
|
else
|
|
|
handler.serializeInt("portrait", portrait, -1);
|
|
|
}
|