1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix events on .vmap's not activating on hero visit

This commit is contained in:
Ivan Savenko
2025-07-07 12:41:45 +03:00
parent d03d096aee
commit 4fc63427b9
2 changed files with 18 additions and 6 deletions

View File

@@ -275,6 +275,12 @@ void CGPandoraBox::serializeJsonOptions(JsonSerializeFormat & handler)
}
}
CGEvent::CGEvent(IGameInfoCallback * cb)
: CGPandoraBox(cb)
, availableFor(PlayerColor::ALL_PLAYERS().begin(), PlayerColor::ALL_PLAYERS().end())
{
}
void CGEvent::init()
{
blockVisit = false;
@@ -333,7 +339,8 @@ void CGEvent::serializeJsonOptions(JsonSerializeFormat & handler)
handler.serializeBool("aIActivable", computerActivate, false);
handler.serializeBool("humanActivable", humanActivate, true);
handler.serializeBool("removeAfterVisit", removeAfterVisit, false);
handler.serializeIdArray("availableFor", availableFor);
if (handler.saving || !handler.getCurrent()["availableFor"].isNull())
handler.serializeIdArray("availableFor", availableFor); // else - keep default value
}
VCMI_LIB_NAMESPACE_END