1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #579 from vcmi/dydzio0614-patch-1

Hackfix crash on "victory by town capture"
This commit is contained in:
Alexander Shishkin 2019-05-04 10:35:13 +03:00 committed by GitHub
commit 49404bfa24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -679,6 +679,11 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
else
{
cb->setOwner(this, h->tempOwner);
if(cb->gameState()->getPlayerStatus(h->getOwner()) == EPlayerStatus::WINNER)
{
return; //we just won game, we do not need to perform any extra actions
//TODO: check how does H3 behave, visiting town on victory can affect campaigns (spells learned, +1 stat building visited)
}
removeCapitols(h->getOwner());
cb->heroVisitCastle(this, h);
}