mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix neutral objects serializing
This commit is contained in:
parent
8406e3e4cd
commit
c3663e4e1b
@ -341,6 +341,9 @@ void CGObjectInstance::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||
|
||||
void CGObjectInstance::serializeJsonOwner(JsonSerializeFormat & handler)
|
||||
{
|
||||
if(handler.saving && tempOwner == PlayerColor::NEUTRAL)
|
||||
return;
|
||||
|
||||
ui8 temp = tempOwner.getNum();
|
||||
|
||||
handler.serializeEnum("owner", temp, PlayerColor::NEUTRAL.getNum(), GameConstants::PLAYER_COLOR_NAMES);
|
||||
|
@ -118,7 +118,10 @@ void Initializer::initialize(CGHeroInstance * o)
|
||||
|
||||
o->tempOwner = defaultPlayer;
|
||||
if(o->ID == Obj::PRISON)
|
||||
{
|
||||
o->subID = 0;
|
||||
o->tempOwner = PlayerColor::NEUTRAL;
|
||||
}
|
||||
|
||||
if(o->ID == Obj::HERO)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user