1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

fix tavern

This commit is contained in:
Laserlicht
2023-10-13 01:38:33 +02:00
parent 9e508fe2c2
commit 3c117da4eb
3 changed files with 30 additions and 23 deletions

View File

@ -489,7 +489,7 @@ CTavernWindow::CTavernWindow(const CGObjectInstance * TavernObj, const std::func
recruit->addHoverText(CButton::NORMAL, boost::str(boost::format(CGI->generaltexth->tavernInfo[1]) % LOCPLINT->cb->howManyHeroes(false)));
recruit->block(true);
}
else if(LOCPLINT->castleInt && LOCPLINT->castleInt->town->visitingHero)
else if((LOCPLINT->castleInt && LOCPLINT->castleInt->town->visitingHero) || (dynamic_cast<const CGTownInstance *>(TavernObj) && dynamic_cast<const CGTownInstance *>(TavernObj)->visitingHero))
{
recruit->addHoverText(CButton::NORMAL, CGI->generaltexth->tavernInfo[2]); //Cannot recruit. You already have a Hero in this town.
recruit->block(true);
@ -501,6 +501,8 @@ CTavernWindow::CTavernWindow(const CGObjectInstance * TavernObj, const std::func
}
if(LOCPLINT->castleInt)
CCS->videoh->open(LOCPLINT->castleInt->town->town->clientInfo.tavernVideo);
else if(dynamic_cast<const CGTownInstance *>(TavernObj))
CCS->videoh->open(dynamic_cast<const CGTownInstance *>(TavernObj)->town->clientInfo.tavernVideo);
else
CCS->videoh->open(VideoPath::builtin("TAVERN.BIK"));
}