1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Fixed serialization of PlayerColor in json

This commit is contained in:
Ivan Savenko
2023-09-04 22:21:57 +03:00
parent 86a7f5f5cd
commit 12c4f8d18c
4 changed files with 8 additions and 12 deletions

View File

@ -341,12 +341,7 @@ void CGObjectInstance::serializeJsonOptions(JsonSerializeFormat & handler)
void CGObjectInstance::serializeJsonOwner(JsonSerializeFormat & handler)
{
ui8 temp = tempOwner.getNum();
handler.serializeEnum("owner", temp, PlayerColor::NEUTRAL.getNum(), GameConstants::PLAYER_COLOR_NAMES);
if(!handler.saving)
tempOwner = PlayerColor(temp);
handler.serializeId("owner", tempOwner, PlayerColor::NEUTRAL);
}
BattleField CGObjectInstance::getBattlefield() const