1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Merge pull request #1576 from vcmi/fix-campaigns

Hack to fix campaigns
This commit is contained in:
Andrii Danylchenko 2023-02-16 20:22:41 +02:00 committed by GitHub
commit 27ef876bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -246,7 +246,6 @@ void LibClasses::init(bool onlyEssential)
void LibClasses::clear()
{
delete generaltexth;
delete heroh;
delete arth;
delete creh;
@ -263,6 +262,7 @@ void LibClasses::clear()
delete scriptHandler;
#endif
delete battlefieldsHandler;
delete generaltexth;
makeNull();
}

View File

@ -1621,6 +1621,13 @@ void CGHeroInstance::serializeJsonOptions(JsonSerializeFormat & handler)
if(!handler.saving)
{
if(!appearance)
{
// crossoverDeserialize
type = VLC->heroh->objects[subID];
appearance = VLC->objtypeh->getHandlerFor(Obj::HERO, type->heroClass->getIndex())->getTemplates().front();
}
patrol.patrolling = (rawPatrolRadius > NO_PATROLING);
patrol.initialPos = visitablePos();
patrol.patrolRadius = (rawPatrolRadius > NO_PATROLING) ? rawPatrolRadius : 0;