mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Further fix for mantis #2599
This commit is contained in:
parent
8f7b0dac45
commit
c45a256816
@ -269,17 +269,18 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
|
|||||||
const CGHeroInstance *h = dynamic_cast<const CGHeroInstance *>(hero);
|
const CGHeroInstance *h = dynamic_cast<const CGHeroInstance *>(hero);
|
||||||
|
|
||||||
ERROR_RET_VAL_IF(!h, "That's not a hero!", false);
|
ERROR_RET_VAL_IF(!h, "That's not a hero!", false);
|
||||||
ERROR_RET_VAL_IF(!isVisible(h->getPosition(false)), "That hero is not visible!", false);
|
|
||||||
|
|
||||||
InfoAboutHero::EInfoLevel infoLevel = InfoAboutHero::EInfoLevel::BASIC;
|
InfoAboutHero::EInfoLevel infoLevel = InfoAboutHero::EInfoLevel::BASIC;
|
||||||
|
|
||||||
if(hasAccess(h->tempOwner))
|
if(hasAccess(h->tempOwner))
|
||||||
infoLevel = InfoAboutHero::EInfoLevel::DETAILED;
|
infoLevel = InfoAboutHero::EInfoLevel::DETAILED;
|
||||||
|
|
||||||
if ( (infoLevel == InfoAboutHero::EInfoLevel::BASIC) && gs->curB) //if it's battle we can get enemy hero full data
|
if (infoLevel == InfoAboutHero::EInfoLevel::BASIC)
|
||||||
{
|
{
|
||||||
if(gs->curB->playerHasAccessToHeroInfo(*player, h))
|
if(gs->curB && gs->curB->playerHasAccessToHeroInfo(*player, h)) //if it's battle we can get enemy hero full data
|
||||||
infoLevel = InfoAboutHero::EInfoLevel::INBATTLE;
|
infoLevel = InfoAboutHero::EInfoLevel::INBATTLE;
|
||||||
|
else
|
||||||
|
ERROR_RET_VAL_IF(!isVisible(h->getPosition(false)), "That hero is not visible!", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (infoLevel == InfoAboutHero::EInfoLevel::BASIC) && nullptr != selectedObject)
|
if( (infoLevel == InfoAboutHero::EInfoLevel::BASIC) && nullptr != selectedObject)
|
||||||
|
Loading…
Reference in New Issue
Block a user