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

Removed pointer to VLC entity from CStackBasicDescriptor

This commit is contained in:
Ivan Savenko
2024-10-12 16:02:35 +00:00
parent c98ac01e7a
commit d3af9f1c67
38 changed files with 140 additions and 160 deletions

View File

@@ -345,10 +345,10 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
for(auto & elem : info.army)
{
if(static_cast<int>(elem.second.type->getAIValue()) > maxAIValue)
if(static_cast<int>(elem.second.getCreature()->getAIValue()) > maxAIValue)
{
maxAIValue = elem.second.type->getAIValue();
mostStrong = elem.second.type;
maxAIValue = elem.second.getCreature()->getAIValue();
mostStrong = elem.second.getCreature();
}
}
@@ -357,7 +357,7 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
else
for(auto & elem : info.army)
{
elem.second.type = mostStrong;
elem.second.setType(mostStrong);
}
};
@@ -390,7 +390,7 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
if(nullptr != mostStrong) //possible, faction may have no creatures at all
for(auto & elem : info.army)
elem.second.type = mostStrong;
elem.second.setType(mostStrong);
};