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

Extending hero info callback

Allow to check battle enemy hero details + adding max spell points to available data
This commit is contained in:
dydzio
2016-09-27 13:48:04 +02:00
parent 2576dd4692
commit d831c087d9
3 changed files with 12 additions and 1 deletions

View File

@@ -273,6 +273,16 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
bool accessFlag = hasAccess(h->tempOwner);
if (!accessFlag && gs->curB) //if it's battle we can get enemy hero full data
{
ui8 playerSide = gs->curB->playerToSide(*player);
if (playerSide >= 0)
{
if (gs->curB->sides[!playerSide].hero == h)
accessFlag = true;
}
}
if(!accessFlag && nullptr != selectedObject)
{
const CGHeroInstance * selectedHero = dynamic_cast<const CGHeroInstance *>(selectedObject);