1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Fix game startup

This commit is contained in:
Ivan Savenko
2023-10-26 16:50:29 +03:00
parent cc30bdda04
commit 461c481ef3
6 changed files with 20 additions and 14 deletions

View File

@@ -529,7 +529,7 @@ void CGameState::randomizeMapObjects()
auto * hero = dynamic_cast<CGHeroInstance *>(object);
auto * town = dynamic_cast<CGTownInstance *>(object);
if (hero)
if (hero && hero->ID != Obj::PRISON)
map->heroesOnMap.emplace_back(hero);
if (town)
@@ -579,7 +579,7 @@ void CGameState::placeStartingHero(const PlayerColor & playerColor, const HeroTy
CGObjectInstance * hero = handler->create(handler->getTemplates().front());
hero->ID = Obj::HERO;
hero->subID = VLC->heroh->objects[heroTypeId]->heroClass->getIndex();
hero->subID = heroTypeId;
hero->tempOwner = playerColor;
hero->pos = townPos;
@@ -1826,10 +1826,10 @@ void CGameState::buildBonusSystemTree()
buildGlobalTeamPlayerTree();
attachArmedObjects();
for(CGTownInstance *t : map->towns)
{
t->deserializationFix();
}
// for(CGTownInstance *t : map->towns)
// {
// t->deserializationFix();
// }
// CStackInstance <-> CCreature, CStackInstance <-> CArmedInstance, CArtifactInstance <-> CArtifact
// are provided on initializing / deserializing